This is the query
$db=mysql_connect('localhost','root','root');
mysql_select_db('test');
$query=mysql_query("SELECT * FROM table");
$r=mysql_fetch_assoc($query);
print_r($r);
It only gives me the first element.
But in PhpMyAdmin it gives me all the elements.
How can I make it work in PHP?
mysql_fetch_assocfetches one row per function call. What you want is probably: