user display problem
Posted: Mon May 19, 2008 11:15 am
ok so i am attempting to create a user display panel that shows all the registered users.
here is the code i tried:
i know this is probably completely wrong i just cannot get it to post the user names
thanks in advance
here is the code i tried:
Code: Select all
<?php
define ( 'DB_USER', '****' );
define ( 'DB_PASS', '****' );
define ( 'DB_DB', '******' );
define ( 'DB_HOST', '******' );
mysql_connect(DB_HOST,DB_USER,DB_PASS) or die("Error connecting to Database! Please Try again." . mysql_error());
mysql_select_db(DB_DB) or die("Cannot select database! Please Try again." . mysql_error());
echo "Current users: "
?>
<br /><br /><br />
<?php
$sql = "SELECT * FROM `users` WHERE `username` AND `email`";
$result = mysql_query($sql)or die(mysql_error());
$row = mysql_fetch_assoc($result);
echo "<h2>" . $row['user'] . "</h2><br />";
echo "<h2>" . $row['email'] . "</h2><br />";
?>i know this is probably completely wrong i just cannot get it to post the user names
thanks in advance