Hello all, being relatively new to PHP, I'm in search of some help regarding displaying data that is contained in my database. It's a very simple script that allows users to type in their alias and their comment on a website. Here's the code I'm using to display the data:
$result = mysql_query("SELECT * FROM comments");
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"alias");
$f2=mysql_result($result,$i,"comment");
$i++;
}
echo $f1;
echo " : ";
echo $f2;
But when the code executes, the only thing displayed is the colon ":".
I know that there is atleast 6 records in the database, so lack of data is not the issue.
Any suggestions?
Thanks!