My question is how to display all data from my users table in my database? I have this.
$loop = mysql_query(“SHOW users FROM $dbname”) or die (‘cannot select tables’);
My question is how to display all data from my users table in my database? I have this.
$loop = mysql_query(“SHOW users FROM $dbname”) or die (‘cannot select tables’);
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$result = mysql_query(“SELECT * FROM Users”, $link) or die (‘cannot select tables’);
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}
mysql_free_result($result);