Dear all;
I write this php file and when I want to view it does not make sense. It also can't retrieve the necessasry info from my database:( . Please can any one guide me.
Note: I attached my DMV database.
Thanks alot
//===========
<html>
<head>
<title>Displaying Your Vehicles</title>
</head>
<body>
<?php
$host = "localhost";
$user = "";
$password = "";
$db = "DMV";
$table = "myvehicle";
mysql_connect($host,$user,$password) or die("Failed to connect");
mysql_select_db($db) or die("Failed to select database");
$sql = "SELECT * from $table ORDER BY id ASC;";
$result = mysql_query($sql);
if ($row = mysql_fetch_array($result))
{
echo "<p align=\"center\"><font size="5" color=\"#FF0000\">Your Vehicles:</font></p>";
echo
"<table border=\"1\" width=\"100%\" id=\"table1\">
<tr>
<th>
<p dir=\"ltr\">Plate Number</th>
<th>
<p dir=\"ltr\">Vehicle Model</th>
<th>
<p dir=\"ltr\">Registration Date</th>
<th>
<p dir=\"ltr\">Expire Date</th>
<th>
<p dir=\"ltr\">More Info.</th>
</tr>";
do {
echo "<tr>
</tr>";
echo " <tr>
<th>$row[0]</th>
<th>$row[1]</th>
<th>$row[2]</th>
<th>$row[3]</th>
<th> </th>
</tr>";
}
while($row = mysql_fetch_array($result));
echo"</table></div>";
}
else
echo "<p><i><b><font face=\"Chiller\" size="6" color=\"#FF0000\">Sorry dear</font><font face=\"Chiller\" size="5" color=\"#800000\">,
there is may be an error in our system, please contact us.</font></b></i></p>";
?>
//===========