hey all. i have this code that is retrieving data from my db. it should echo the results of a table if there are any entries but if there are no entries it should echo a message indicating that. it is giving me the following error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, integer given in C:\wamp\www\uma\test.php on line 22. Here is the code please let me know what i'm doing wrong.
<?php
mysql_connect("localhost", "root") or
die ("Check your server connection.");
mysql_select_db("uma");
$result = mysql_query("Select * From mywords WHERE member_id='1' order by date_added desc");
$mywords = mysql_num_rows($result);
if($mywords<1)
{echo "No Comments Yet";}
else
{
while($row = mysql_fetch_array($mywords))
{
echo "<tr>";
echo "<td align=left>" . date('F dS Y g:ia', strtotime( $row['date_added'] )) . "<br>" . $row['my_words'] . "<br><br>" . "</td>";
echo "</tr>";
}
}
?>