Hi All
I just bought a new book PHP5 in easy step but i have managed to connect to my database.
I have a database which is holding branches adresses it uses a drop-down to select one adress and diplay its adress name so im battling with writing a query that will select one adress from the db and show the details pls help
How do i select one adress and show the details of each branch using php a for loop
The javascript file work well
this is my contact.php
<html>
<head><TITLE>Main Centre Adresses</TITLE></head>
<body>
<h2>
<?php
$conn = @mysql_connect ("localhost", "thikho", "password") or die ("Sorry - unable to connect to Mysql");
$rs = @mysql_select_db("MainIntranet", $conn ) or die ("Err:Db");
$sql = "SELECT * FROM Maincentre_adress WHERE `id` = id ORDER BY `id` ASC";
$rs = mysql_query($sql,$conn);
while($row=mysql_fetch_array($rs))
{
?>
<div id="blm" style="position:absolute; left:423px; top:103px; width:137px; height:370px; z-index:1; visibility: hidden">
<table width="138" border="0" cellspacing="0" cellpadding="0">
<td width="6"> </td>
<td><font class="lightgrey"><br>
<b><?php echo $row["name"]; ?></b><br>
<?php echo $row["adresline1"]; ?><br>
<?php echo $row["adresline2"]; ?><br>
<?php echo $row["adresline3"]; ?><br>
<br>
Tel. <?php echo $row["tel"]; ?><br>
Fax. <?php echo $row["fax"]; ?></font>
</td>
</tr>
</table>
</div>
<?php
}
?>
<table width="142" border="0" cellspacing="0" cellpadding="0" height="450">
<form method="post" action="">
<input type="hidden" name="currSel" value="">
<tr>
<td rowspan="2" valign="top"></td>
<td rowspan="2" valign="top" ></td>
<td valign="top" height="60" width="138"><br>
<select name="select2" onChange="DoOnChange();">
<option selected>Select Centre</option>
<option value="blm">Bloemfontein</option>
<option value="ct">Cape Town</option>
<option value="dur">Durban</option>
<option value="el">East London</option>
<option value="geo">George</option>
<option value="jhb">Johannesburg</option>
<option value="nel">Nelspruit</option>
<option value="pta">Pretoria</option>
<option value="pe">Port Elizabeth</option>
<option value="ptg">Polokwane</option>
<option value="val">Vaal</option>
</select>
</td>
</tr>
<tr>
<td valign="top" height="380"><br>
</td>
</tr>
</form>
</table>
</h2>
</body>
</html>