hi
I have a dropdown menu that reads from a MYSQL databse and displays customer names (included below).
How would I use this dropdown to pass a CustomerID to a second PHP page that contains a query that would select further information about chosen customer.
Many Thanks James
[php]
<?php //------------------------------------------------------------------------------------------------------------------------------------------------------ //James Flowers 2014 //------------------------------------------------------------------------------------------------------------------------------------------------------ //database configuration $config['mysql_host'] = "xxx"; $config['mysql_user'] = "xxx"; $config['mysql_pass'] = "xxx"; $config['db_name'] = "xxx"; //------------------------------------------------------------------------------------------------------------------------------------------------------ mysql_connect($config['mysql_host'],$config['mysql_user'],$config['mysql_pass']);//connect to host //------------------------------------------------------------------------------------------------------------------------------------------------------ @mysql_select_db($config['db_name']) or die( "Unable to select database"); //select database //------------------------------------------------------------------------------------------------------------------------------------------------------ $sql ="select customerName , customerNumber from customers"; //SQL goes here $result = mysql_query($sql); if (!$result) {die('Invalid query: ' . mysql_error()); } $result = mysql_query($sql) or die(mysql_error()); $dropdown = ""; while($row = mysql_fetch_assoc($result)) {$dropdown .= "\r\n{$row['customerName']}";} $dropdown .= "\r\n"; ?> <?php echo $dropdown; ?>[/php]