Page 1 of 1

Displaying information

Posted: Tue Nov 22, 2005 7:18 pm
by InnerShadow
I was wondering what the exact syntax for selecting information from a database and then displaying that? Any help would be great.

Posted: Tue Nov 22, 2005 7:25 pm
by Burrito

Code: Select all

$result = mysql_query("select * from myTable")
  or die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
  echo $row['somefieldfromtable'];
}

Posted: Tue Nov 22, 2005 7:40 pm
by John Cartwright
mysql_connect(), mysql_select_db, mysql_query(), mysql_fetch_assoc()

This documentation should get you started