Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

select menu to show record selected on same page

$
0
0

I have dynamic select list that is populated with countries (each country has information (shops) that is associated it. When the country is selected i want the shop information to show below then menu.

 

the statement for the shop is

mysql_select_db($database_beau, $beau);
$query_rsStockists = "SELECT * FROM beauAW13_stockist, beauAW13_stockistLoc WHERE beauAW13_stockist.stockistLocID = beauAW13_stockistLoc.stockistLocID";
$rsStockists = mysql_query($query_rsStockists, $beau) or die(mysql_error());
$row_rsStockists = mysql_fetch_assoc($rsStockists);
$totalRows_rsStockists = mysql_num_rows($rsStockists);
 
mysql_select_db($database_beau, $beau);
$query_rsCountries = "SELECT * FROM beauAW13_stockistLoc";
$rsCountries = mysql_query($query_rsCountries, $beau) or die(mysql_error());
$row_rsCountries = mysql_fetch_assoc($rsCountries);
$totalRows_rsCountries = mysql_num_rows($rsCountries);

the select list is

 <form id="form1" name="form1" method="post" action="">
    <label for="select"></label>
    <select name="select" id="select">
      <?php
do { 
?>
      <option value="<?php echo $row_rsCountries['stockistLocID']?>"><?php echo $row_rsCountries['stockistLocName']?></option>
      <?php
} while ($row_rsCountries = mysql_fetch_assoc($rsCountries));
  $rows = mysql_num_rows($rsCountries);
  if($rows > 0) {
      mysql_data_seek($rsCountries, 0);
            $row_rsCountries = mysql_fetch_assoc($rsCountries);
  }
?>
    </select>
    <input type="submit" name="button" id="button" value="go" />
  </form>

and the shop information that i want to appear below is

 <p><?php echo $row_rsStockists['stockistName']; ?><br />
    <?php echo $row_rsStockists['stockistAdd1']; ?><br />
    <?php echo $row_rsStockists['stockistTown']; ?><br />
    <?php echo $row_rsStockists['stockistCounty']; ?><br />
    <?php echo $row_rsStockists['stockistCountry']; ?><br />
    <?php echo $row_rsStockists['stockistPostCode']; ?><br />
    <?php echo $row_rsStockists['stockistWWW']; ?></p>

thanks for you help in advance


Viewing all articles
Browse latest Browse all 13200

Trending Articles