Why don't this PHP MYSQL work?

  • Thread starter Thread starter The Best Jack
  • Start date Start date
T

The Best Jack

Guest
I have a maffia game and you can own the Blackjack game this is the script for claiming the game.

elseif ($grab == "Blackjack"){

$check = mysql_query("SELECT * FROM bj WHERE bjowner= '0' AND location='$fetch->location'");
$num_rows = mysql_num_rows($check);

if ($num_rows != "0"){

if ($fetch->location == $location){

mysql_query("UPDATE bj SET bjowner='$username',bjmaxbet='0',bjearnings='0',bjminbet='0' WHERE location='$fetch->location'");
echo "You got the Blackjack!";

It won't let me have the Blackjack game for some reason, the MYSQL table is:

-- Table structure for table `bj`
--

CREATE TABLE `bj` (
`id` int(11) NOT NULL auto_increment,
`bjowner` varchar(100) NOT NULL default '',
`bjmaxbet` int(100) NOT NULL default '0',
`bjearnings` int(100) NOT NULL default '0',
`bjminbet` int(100) NOT NULL default '0',
`location` enum('England','Japan','Colombia','Usa','South Africa','Mexico') NOT NULL default 'England',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `bj`
--

Any help is apprechiated., when I click buy blackjack nothing happens.

Jack.
 
Back
Top