I want to be able to type a dealer name (or partial) into a search box, have a list of records displayed with the dealer name hot linked (which I have currently) ... when the link is clicked, I'd like it to display the selected record only (can't figure this part out).
The below is the code as I have it currently ... In the second 'echo' statement I've got a <a href=\"\"></a> around the $EditName variable ... right now when I click on it, it sends me to the home page of my website (because that's the default on any dead (or nonexistent) link. What do I need to do to make the link display the record of the selected dealer? Thanks.
<?php
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * FROM Dealers WHERE DlrName LIKE '$searchedit%'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
echo "<table border=\"2\" align=\"center\"><tr valign=\"middle\" align=\"center\"><td bgcolor=\"#c0c0c0\"><font size=2><b>User Name</b></td><td bgcolor=\"#c0c0c0\"><font size=2><b>User City</b></td><td bgcolor=\"#c0c0c0\"><font size=2><b>User ID</b></td><td bgcolor=\"#c0c0c0\"><font size=2><b>Dlr Number</b></td></tr>";
while ($i < $num) {
$EditName=mysql_result($result,$i,"DlrName");
$EditCity=mysql_result($result,$i,"DlrCity");
$EditID=mysql_result($result,$i,"UserID");
$EditNumber=mysql_result($result,$i,"DlrNumber");
echo "<tr align=\"left\" valign=\"top\"><td><font size=2><a href=\"\">$EditName</a></td><td><font size=2>$EditCity</td><td align=\"right\"><font size=2>$EditID</td><td align=\"center\"><font size=2>$EditNumber</td></tr>";
++$i;
}
echo "</table><br><font size=\"2\" face=|\"verdana,arial\"><br><br><br>";
}
?>