Re: Change styling depending on var value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 20, 2009, at 2:29 PM, Ashley Sheridan wrote:

> On Fri, 2009-11-20 at 17:23 -0500, Phil Matt wrote:
> 
>> Ashley Sheridan wrote:
>> 
>>> put
>>> 
>>> var_dump($row);
>>> 
>> I inserted this line in the script at the end of the html table, still 
>> inside the PHP echo statement.
>> 
>> This yields:
>> 
>> bool(false)
>> 
>> Cheers --- Phil
> 
> 
> That means that $row doesn't contain what you thought it did. It
> contains the boolean value false (which is different from the string
> 'false') Are you sure you spelt the varialbe correctly in all of your
> code?

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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux