zetsumei
December 21st, 2006, 12:28 AM
I'm getting this mysql_fetch_array error in my php script and I can't figure out what it is.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /opt/lampp/htdocs/quotes.php on line 13
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","************");
//select which database you want to edit
mysql_select_db("otaku_quotes");
//select the table
$result = mysql_query("select * from quotes");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$title=$r["title"];
$message=$r["message"];
$who=$r["who"];
//display the row
echo "<div class='quote'>$message</div>
<div class='quote_author'>$who</div>";
}
?>
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /opt/lampp/htdocs/quotes.php on line 13
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","root","************");
//select which database you want to edit
mysql_select_db("otaku_quotes");
//select the table
$result = mysql_query("select * from quotes");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$title=$r["title"];
$message=$r["message"];
$who=$r["who"];
//display the row
echo "<div class='quote'>$message</div>
<div class='quote_author'>$who</div>";
}
?>