[PHP/MySQL] How to show all mysql output in php?

Experienced Elementalist
Joined
Sep 10, 2006
Messages
208
Reaction score
1
how to show all mysql table output?
ex.:
$query=mysql("select name from account where score='9'");

i want ouput who have score 9 :

peter
jack
teddy

anybody know how? help please?
 
Re: Help, how to show all mysql output in php?

PHP:
while(mysql_query("select NAME from ACCOUNT where SCORE='9'")) {
echo
}
something like that. i forget all the needed info, but thats the basic.
 
Re: Help, how to show all mysql output in php?

That's not going to work. mysql_query() only returns a resource.

PHP:
 $query = mysql_query("SELECT name FROM account WHERE score = 9");

 while ($data = mysql_fetch_array($query))
	{
	echo $data['name'] . "<br />";
	}
 
Back