Created a page with a drop down menu listing names of builders retrieved from a mysql database containing contact info for client builders.
What I need to do, and so far have been stumped, is this:
When a builder name is selected from the drop down, I need to have the selected builders record, (name, address, etc) listed in a table on another page.
The new page would be called viewbuilder.php
Will someone PLEASE help me with the code to accomplish this??
Here is the code for the page having the drop down menu. As you can see I am using Dreamweaver.
Expand|Select|Wrap|Line Numbers
- <?php require_once('Connections/btest.php'); ?>
- <?php
- mysql_select_db($database_btest, $btest);
- $query_Recordset1 = "SELECT * FROM builder ORDER BY bname ASC";
- $Recordset1 = mysql_query($query_Recordset1, $btest) or die(mysql_error());
- $row_Recordset1 = mysql_fetch_assoc($Recordset1);
- $totalRows_Recordset1 = mysql_num_rows($Recordset1);
- ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- </head>
- <body>
- <form id="form1" name="form1" method="post" action="">
- builder
- <select name="select">
- <option value="?">-Please Select-</option>
- <?php
- do {
- ?>
- <option value="<?php echo $row_Recordset1['bname']?>"><?php echo $row_Recordset1['bname']?></option>
- <?php
- } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
- $rows = mysql_num_rows($Recordset1);
- if($rows > 0) {
- mysql_data_seek($Recordset1, 0);
- $row_Recordset1 = mysql_fetch_assoc($Recordset1);
- }
- ?>
- </select>
- </form>
- </body>
- </html>
- <?php
- mysql_free_result($Recordset1);
- ?>