Database Problem
| From: | Jeff Wilhelm | Date: | Tue, 11 Jul 2000 17:58:07 +0000 |
| Subject: | Database Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5962@lists.php.net to get a copy of this message | ||
This code is suppsed to go into the database in grab the records with the
provided 'productid' and print each one of them out. For some reason it is
only returning 'Resource id #2' (or multiple 'Resource id #2' if there is
more than one record with that productis). Anyone have any ideas? I'm sure
it's a simple mistake...
-Jeff
<?
include "database.inc";
$productid = "61";
$comments = mysql_query("select comment from comments where productid =
$productid") or die(mysql_error());
if ($comments) {
while (mysql_fetch_array($comments)) {
print "$comments";
}
}
?>