ok... i have solved most of my problems now.. umm how can i add items to a list on my form using the records from my database? <- got this working.. but the problem is.. the results are shown on a diffrent page.. i am wondering how can i expose all results on the same page.. i will post the code..
PHP Code:<html>
<head>
</body>
<form>
<p>
<select name="mGrid" id="mGrid">
<option value="NONE">----- SELECT GRID -----</option>
<option value="NORTH">NORTH</option>
<option value="EAST">EAST</option>
<option value="SOUTH">SOUTH</option>
<option value="WEST">WEST</option>
</select>
<input type="button" name="Button" value="Button" onClick="show()"> ** how can i call show after clicking the button?? **
<br>
<br>
<select name="select" size="10">
<option>--------------- LIST OF BRANCHES ---------------</option>
</select>
</form>
</html>
<? function show(){
$host = 'localhost';
$user = 'root';
$password = 'admin';
$conn = mysql_connect($host, $user, $password)
or die ("Could Not Connect to DB");
$mooo = '$mGrid';
$sd = mysql_select_db("ifl-sales", $conn)
or die ("Could Not Select DB" . mysql_error());
$tableaccess = "select branch_name from branch where grid = '$mooo'";
$sb = mysql_query($tableaccess, $conn);
while ($row = mysql_fetch_array ($sb))
{
echo("<option>");
echo($row['branch_name']);
}
}
?>
everytime ic click the button nothing happens..![]()




Reply With Quote