no recordset identifier return on MySQL queries
| From: | Mark A Mucha | Date: | Sun, 18 Jun 2000 19:09:21 +0000 |
| Subject: | no recordset identifier return on MySQL queries | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-453@lists.php.net to get a copy of this message | ||
Hi,
I am fairly new to PHP. I run some code and get no result identifier on a mysql query :O(
I can't figure out what is going wrong.
*********************************** CODE ************************************
<?php
if(!($conn = mysql_connect("my", "", ""))){
echo "Error opening database.\n";
exit();
}
else{
echo "Database connection complete.<br>\n";
echo "The conn number is $conn.<br>\n";
}
$database = "linkCount";
mysql_select_db("linkCount",$conn);
$sql = "SELECT * FROM links";
$records = mysql_db_query(linkCount, $sql);
echo "The result form mysql_db_query is ($records)";
$records = mysql_query($sql, $conn);
echo "the result from mysql_query is $records";
echo "<table border=2>";
echo "<tr><td>Link
Id</td><td>Link</td><td>Count</td><td>Master
ID</td><td>Type</td></tr>";
while($row = mysql_fetch_object(1)){
?>
***************************************** END CODE *********************************************
Database connection complete.
The conn number is Resource id #1.
the result from mysql_query is Link Id Link Count Master ID Type
Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot\mysql\tester.php on line 27