mysql_fetch_array() error: invalid MySQL result resource?
Posted: Wed Jun 18, 2008 1:34 am
Hi all,
I'm stumped on what seems like should be just a simple retrieval of one cell in my mysql table. I'v read the manual for mysql_fetch_array() and I don't see what the problem is. The MySQL query works fine as in my MySQL client.
returns:
Any thoughts?
Thank you.
I'm stumped on what seems like should be just a simple retrieval of one cell in my mysql table. I'v read the manual for mysql_fetch_array() and I don't see what the problem is. The MySQL query works fine as in my MySQL client.
Code: Select all
<?php
require_once ('inc/dbopen.php');
?>
<div id="messages">
<textarea name="message" cols="80" rows="7">
<?php
$result = mysql_query("SELECT message FROM content ORDER BY created DESC LIMIT 1;");
$row = mysql_fetch_array($result); //This is row 20
echo $row[0];
?>
</textarea>
</div>
inside my text area.<br />
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/Applications/MAMP/htdocs/diversified/index.php</b> on line <b>20</b><br />
Any thoughts?
Thank you.