Strange coding bug
| From: | Pat Hanna | Date: | Mon, 05 Jan 2004 19:59:55 +0000 |
| Subject: | Strange coding bug | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173777@lists.php.net to get a copy of this message | ||
I cannot seem to find the problem in my code. I have two pages. Both
need to select a product from a database. The first page works fine, the
product is found and I use the data in the page. The second one does not
fetch the product. The code is exactly the same:
$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.
But if I do it on the second page I get nothing. Both pages are
connected to the database and I get no errors in code. I have included
the full code of each page in the attachment. Item_details.php3 is the
working page and addtocart.php3 is the one that won't seem to connect.
Thanks,
Patrick