Re: Change styling depending on var value

From: Date: Mon, 23 Nov 2009 14:41:03 +0000
Subject: Re: Change styling depending on var value
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.general 
Request: Send a blank email to php-general+get-300038@lists.php.net to get a copy of this message
Mari Masuda wrote:
This may be a dumb question, but did you actually fetch the db query's results and put them in $row before trying to use $row? In MySQL you could do something like: $query = "select * from my_table"; $result = mysql_query($query); $row = mysql_fetch_array($result); //this statement would need to be inside of a loop if there is more than one result Thanks, Mari. That was it: I usually declare the variables first, then on with the rest of the code. I had inserted the $row conditional values right after the vars, before the rest of the query...just plain dumb.
Cheers --- Phil

« previous php.general (#300038) next »