jayavani
Mar 19, 2011, 11:16 AM
Hai......someone *** help me.......
Food_ID:
Food_id :
Food_Name :
Above is my interface...for the 1st food_ID I'm using drop down button...so now I want when I click drop down button it should fetch food_id from DB...ten when I select one ID...I wan the information about that ID show in 2nd food_id text field and the food name should appear in food_name text field......*** help.......
Below I attach my code.....
**************************************'
<?php
Include 'include/opendb.php';
Require_once("models/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add new</title>
</head>
<body>
<div align="center">WELCOME TO AMIGO WIRELESS RESTAURANT SYSTEM</div>
<p align="center"> FOOD</p>
<p align="center"><label>
<div align="left">
<p><strong>Food_ID: </strong>
<select name="menu" id="menu">
<?php
$result = mysql_query('SELECT food_id , food_name FROM food') or exit(mysql_error());
While ($row = mysql_fetch_assoc($result))
{
Echo '<option value="' . $row['food_id'] . '">' . $row['food_id'] . '</option>';
}
Echo '</select>';
?>
</select>
<p>Food_id :
<input type="text" name="id" id="id" />
<p>
<p>Food_Name :
<input type="text" name="name" id="name" value="" />
<p>F
<form id="form1" name="form1" method="post" action="">
<div align="center">
<input type="submit" name="update" id="update" value="new" />
<input type="submit" name="edit" id="edit" value="edit" />
<input type="reset" name="clear" id="clear" value="clear" />
<input type="submit" name="delete" id="delete" value="delete" />
</div>
</form>
<p align="center"> </p>
</body>
</html>
**************************************'
With above code I'm able to see food_ID in drop down button but I don't know how to pass that to text field.........
Thanking in advance.....
Food_ID:
Food_id :
Food_Name :
Above is my interface...for the 1st food_ID I'm using drop down button...so now I want when I click drop down button it should fetch food_id from DB...ten when I select one ID...I wan the information about that ID show in 2nd food_id text field and the food name should appear in food_name text field......*** help.......
Below I attach my code.....
**************************************'
<?php
Include 'include/opendb.php';
Require_once("models/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-'
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add new</title>
</head>
<body>
<div align="center">WELCOME TO AMIGO WIRELESS RESTAURANT SYSTEM</div>
<p align="center"> FOOD</p>
<p align="center"><label>
<div align="left">
<p><strong>Food_ID: </strong>
<select name="menu" id="menu">
<?php
$result = mysql_query('SELECT food_id , food_name FROM food') or exit(mysql_error());
While ($row = mysql_fetch_assoc($result))
{
Echo '<option value="' . $row['food_id'] . '">' . $row['food_id'] . '</option>';
}
Echo '</select>';
?>
</select>
<p>Food_id :
<input type="text" name="id" id="id" />
<p>
<p>Food_Name :
<input type="text" name="name" id="name" value="" />
<p>F
<form id="form1" name="form1" method="post" action="">
<div align="center">
<input type="submit" name="update" id="update" value="new" />
<input type="submit" name="edit" id="edit" value="edit" />
<input type="reset" name="clear" id="clear" value="clear" />
<input type="submit" name="delete" id="delete" value="delete" />
</div>
</form>
<p align="center"> </p>
</body>
</html>
**************************************'
With above code I'm able to see food_ID in drop down button but I don't know how to pass that to text field.........
Thanking in advance.....





