mysql_fetch_array()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
musbah
Forum Newbie
Posts: 11
Joined: Mon Apr 25, 2011 8:52 pm

mysql_fetch_array()

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: mysql_fetch_array()

Post by Jade »

Can you put [Solved] in your topic header? Thanks.
Post Reply