TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   Weird MYSQL that does not make sense!!!! (http://www.talkphp.com/mysql-databases/3807-weird-mysql-does-not-make-sense.html)

KingOfTheSouth 12-27-2008 05:45 AM

Weird MYSQL that does not make sense!!!!
 
Ok check this out everyone. I am getting this error and it is really making me angry. Here is the code

PHP Code:

$info mysql_fetch_array(mysql_query("SELECT id,pimp,hoes,condom,medicine,crack,thugs,weed,guests,beer,turn,cash,bank,worth,nrank,occupancy,informant,reserve,rating,streetbike,lowrider,hummer,bus, turnbank,valet,valitem,parking,custrides FROM $tab[pimp] WHERE id='$id' AND rid='$rid';")); 


Everything in that query is correct and is inline with the database. Now For some reason I keep getting that error and I do not know what to do!!!!! Please help me

CoryMathews 12-27-2008 06:57 AM

; should not be there for 1. if thats not it what does the error say?

KingOfTheSouth 12-27-2008 06:59 AM

it says this

Quote:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home1/clubbink/public_html/streetlords/game_html.php on line 597

sketchMedia 12-27-2008 07:18 AM

Your query is failing, therefore retuning false and not a resource identifier hence why mysql_fetch_array is moaning.

PHP Code:


$res 
mysql_query("SELECT id,pimp,hoes,condom,medicine,crack,thugs,weed,guests,beer,turn,cash,bank,worth,nrank,occupancy,informant,reserve,rating,streetbike,lowrider,hummer,bus, turnbank,valet,valitem,parking,custrides FROM $tab[pimp] WHERE id='$id' AND rid='$rid'") or die(mysql_error());
$info mysql_fetch_array($res); 

give that a try.

KingOfTheSouth 12-27-2008 07:23 AM

Hmm that did not work now the stats will not show up... I keep getting this Unknown column 'parking' in 'field list'

sketchMedia 12-27-2008 08:39 AM

Well that sounds like the problem to me, add the column to the DB or drop it from the query.

KingOfTheSouth 12-28-2008 07:54 AM

What column would that be?

sketchMedia 12-28-2008 02:40 PM

Quote:

I keep getting this Unknown column 'parking' in 'field list'
The column you just said mysql cannot find.


All times are GMT. The time now is 06:18 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0