here's my error:
Use of undefined constant id
help me to fix my error thanks in advance
heres my code
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="121"; // Mysql password
$db_name="accounts"; // Database name
//$tbl_name="users"; // Table name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$show = "SELECT * FROM users";
$result = mysql_query($show);
while ($show = mysql_fetch_array($result))
{
$feild1=$show[id];
$feild2=$show[username];
$feild3=$show[password];
$feild4=$show[name];
$feild5=$show[date];
echo "id: $feild1<br>";
echo "username: $feild2<br>";
echo "password: $feild3<br>";
echo "name: $feild4<br>";
echo "date: $feild5<br>";
}
?>
Bookmarks