| 
 Posted by Kiza on 06/13/70 11:31 
<?php 
//collect vars&values :D 
foreach ( $_REQUEST as $key => $value ) { 
 $$key = $value; 
 
if ($key == "fruit_name") { 
$fruit_name0 = ("fruit_name like '$value'"); 
 
	$sql = ("SELECT * FROM fruit_table where $fruit_name0"); 
 
	$query = mysql_query($sql); 
 
while ( $row = mysql_fetch_array($query) ) { 
 
	$fruit_name = $row["fruit_name"]; 
	$price = $row["price"]; 
 
echo("$fruit_name = $price<br />");//if U wanth to echo selected data 
:) 
} 
} 
} 
?> 
 
Give name of input or drop down list field like 'fruit_name', and 
script will select fruits and price and print it.
 
[Back to original message] 
 |