dean7 Posted May 8, 2010 Share Posted May 8, 2010 Hi all, I have this piece of code which im using for my website but for a werid reason its saying the table that it selects the information out of doesnt exist when it does. This is my code: $locations = array('England','Japan','Colombia','Usa','South Africa','Mexico'); $i =0; $count = count($locations); while ($i < $count){ if ($i == "2"){ echo "<tr>"; } $airport = mysql_fetch_object(mysql_query("SELECT * FROM airport WHERE location='$locations[$i]'")); $ammo_hut = mysql_fetch_object(mysql_query("SELECT * FROM bf WHERE location='$locations[$i]'")); $bank = mysql_fetch_object(mysql_query("SELECT * FROM bank WHERE location='$locations[$i]'")); $people_in = mysql_num_rows(mysql_query("SELECT * FROM users WHERE location='$locations[$i]'")); $dealer=mysql_fetch_object(mysql_query("SELECT * FROM dealership WHERE location='$locations[$i]'")); $rest=mysql_fetch_object(mysql_query("SELECT * FROM rest WHERE location='$locations[$i]'")); $casino_slots = mysql_fetch_object(mysql_query("SELECT * FROM casino WHERE location='$locations[$i]' AND type='Slots'")) or die (mysql_error()); // Line 168 $rest=mysql_fetch_object(mysql_query("SELECT * FROM rest WHERE location='$locations[$i]'")); $casino_rps = mysql_fetch_object(mysql_query("SELECT * FROM casino WHERE location='$locations[$i]' AND type='RPS'")) or die (mysql_error()); $casino_race = mysql_fetch_object(mysql_query("SELECT * FROM casino WHERE location='$locations[$i]' AND type='Race'")) or die (mysql_error()); $bar = mysql_fetch_object(mysql_query("SELECT * FROM bar WHERE location='$locations[$i]'")); $shop = mysql_fetch_object(mysql_query("SELECT * FROM shop WHERE location='$locations[$i]'")) or die (mysql_error()); The error im getting is: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/www/mafia-drift.co.cc/locations.php on line 168 Table 'deabot96_users.casino' doesn't exist This isnt the full script, if needing to see it all ask . Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/201113-error-in-code/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 8, 2010 Share Posted May 8, 2010 You need to investigate what your actual table name is v.s. what is in your query and attempt to find what is different between the two. You either have a spelling error, a capitalization difference (assuming you are on an operating system that is case-sensitive), or you have some non-printing or special characters as part of the table name. Quote Link to comment https://forums.phpfreaks.com/topic/201113-error-in-code/#findComment-1055117 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.