Page 1 of 1

mysql_fetch_array()

Posted: Sun May 08, 2011 12:07 pm
by musbah
Hey guys I have been getting the : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource error message but I can't really find a problem in the code..

Code: Select all

$sqlC="SELECT * FROM $FileName";
$resultC=mysql_query($sqlC);

while($rows=mysql_fetch_array($resultC)){
?>
<table>
<tr>
<td><?php echo "$rows[Username]"; ?></td>
<td><?php echo "$rows[DateTime]"; ?></td>
</tr>
<tr>
<td><?php echo "$rows[Comment]"; ?></td>
</tr>
</table>
<?php
}
mysql_close(); //close database
?>
Any help would be appreciated, thank you

Edit:
Nvm stupid mistake i forgot to add `` arround the table name

Re: mysql_fetch_array()

Posted: Mon May 16, 2011 12:20 pm
by Jade
Can you put [Solved] in your topic header? Thanks.