RE: [PHP] Strange coding bug
| From: | Jay Blanchard | Date: | Mon, 05 Jan 2004 20:20:22 +0000 |
| Subject: | RE: [PHP] Strange coding bug | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173778@lists.php.net to get a copy of this message | ||
[snip]
$query="SELECT * FROM products WHERE stock_number = '$item_number'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
When I do 'echo $result;' on the first page, I get the result number.
[/snip]
If you
echo $result;
with this code all you should get back is 'array' ($result is an array)
Do this
print_r($row) and see what happens.
P.S. Attachements are stripped on the way to the list usually, so post
the relevant small bits of code in your e-mail.