View Full Version : Help to display data from DB as hyperlink

07-26-2011, 09:28 PM
I have a database containing information on customers of ours. I have a code to display all the names of our customers as well.

mysql_connect ("localhost", "bail_admin", "REMOVED") or die ('Could not connect to the MySQL Database because : ' . mysql_error());
mysql_select_db ("bail_bail") or die(mysql_error());
$query = mysql_query ("SELECT fname FROM bailfiles") or die(mysql_error());
while ($row = mysql_fetch_array($query))


echo "<br />Name:".$row[fname];


This code works fine, but I would like to make each name a hyperlink to a PHP file that will take the variable for "name" and display all the data surrounding the customer.

I'm figuring the best way to do it would be to make a form that inputs the value of "name" to a code like "SELECT * FROM $name" and have them echoed.

Only problem is I am unable to figure out how to make this input form into a hyperlink. I don't even know if that is possible.

Any advice?

07-26-2011, 09:29 PM
Could I possibly use the GET method and do it all via URL?