$results = mysql_query(" select * from table_name ");
while($r = mysql_fetch_array( $results ))
{
//You have an associated array ($r) with the results of the database.
echo $r['name']; //Prints the value of column 'name'
//Then, if you want to create an ordinary array, do this:
static $i=0;
name[$i] = $r['name'];
$i++;
//And like that with all column names.
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment