note 111075 rejected from function.mysql-fetch-row by googleguy
| From: | googleguy@php.net | Date: | Fri, 11 Jan 2013 19:28:47 +0000 |
| Subject: | note 111075 rejected from function.mysql-fetch-row by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192944@lists.php.net to get a copy of this message | ||
Note Submitter: rajparu2011 at gmail dot com
----
Hey guys, i'm getting this error when ever I try to run the code below! Please help! It's
an emergency!
ERROR:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
/home/u967246295/public_html/admin.php on line 121
CODE:
<?php
$con =
mysql_connect("mysql.serversfree.com","u967246295_root","anandrao");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$result = mysql_query("SELECT * FROM reg");
if (!$result) {
echo 'Could not run query: ';
}
$row = mysql_fetch_row($result);
echo $row[0];
echo $row[1];
?>