How would I make this into a PHP script where it displays the output?

Team Potter

New member
How would I make this code:

$sql = ' SELECT *'
. ' FROM `users`'
. ' LIMIT 0 , 30 ';

Into a PHP script where it would display the output of the MySQL query? Or, how would I be able to see all entries in the database from a PHP script? Thanks!
 
Do your connections to your database, then:

$query = mysql_query($sql));

while($row = mysql_fetch_array($query))
{
echo $row["FieldName"];
}

Change Field name to the field from your db which you want to echo.
 
Back
Top