this is code to display the datas from db to web page ..

im not getting the outputphp,mysql


mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$query="SELECT * FROM database";



echo "<b><center>List Of Employees</center></b><br><br>";

while ($i < $num) {


echo "<b>$name



Recommended Answers

All 3 Replies

The table name is "database"? check if your query is right. Bye.

nope..my db is sample and tablename is users

$query = "SELECT * FROM `database`"; // use backticks, database may be a reserved word
$result = mysql_query($query) or die(mysql_error()); // if it still fails, show use the error
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.