hi
i'm new to php, i already have a database called msansi its table called provinces i've already created a drop down list of all my nine provinces now what i want to do is, i want the cities associated with the provinces to display on the same page as the drop down list i.e if you click on gauteng the cities in gauteng have to appear on the same page.
here's my code
<html>
<head><title><?php echo $title;?></title></head>
<body>
<h1><?php echo $heading;?></h1>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("msansi", $con);
$result = mysql_query("SELECT * FROM provinces");
echo "<select name=province>";
while($row = mysql_fetch_array($result))
{
{
echo "<option value>" . $row['title']."</option>";
}
}
//<option>Select Province</option>}
echo "</select>";
i tried doing it in javascript and the code is
<script language="javascript" type="text/javascript">
if (<select name==$title)
{
document.write("<b>$row['BODY']</b>");
BODY.getElementsBytitle('title');
{
else
return null;
}
}
</script>
</body>
</html>
where title is the column name of the provinces and BODY is the column name for the cities, i used a different framework called codeigniter.