I have been struggling to write a javascript function that returns a php array of product and was wondering if you can help out please.
I have 3 tables in MySQL database that looks like this.
[CODE]Oval:
ovpool_id: ovpool_size: ovHeating_Source: ovFuel_Cost_perUnit:
1
2
3
4
Round:
rdpool_id: rdpool_size: rdHeating_Source: rdFuel_Cost_perUnit:
1
2
3
Rectangular:
recpool_id: recpool_size: recHeating_Source: recFuel_Cost_perUnit:
1
2
3
4
[/CODE]
and i have an HTML form section that looks like this
<tr>
<td>Pool Shape & Size</td>
<td>
<input type="radio" value="1" name="Pool_Shape" >Oval<br>
<input type="radio" value="2" name="Pool_Shape" >Round<br>
<input type="radio" value="3" name="Pool_Shape">Rectangular<br>
<div id="_Shapes" name =""><!-- style="display:none">-->
<select id = "_Shape" name ="size_In_Feets">
</select>
</div>
</td>
what i want to archieve is when a user clicks on one of th radio button then a selection menu show list the pool_sizes of the product selected and also keep the pool_id as the selected index.
I have idea of how to change the click event when a button is click but i can get my head round to make it display the Xpool_size.
currently i have these 3 function that only returns a php array of the pool table
function getOvalPool(){
$connectioon = initDB();
$query = "SELECT * FROM Oval";
$result = mysql_query($query);
closeDB($connection);
return $result;
}
function getRoundPool(){
$connectioon = initDB();
$query = "SELECT * FROM Round";
$result = mysql_query($query);
closeDB($connection);
return $result;
}
function getRectPool(){
$connectioon = initDB();
$query = "SELECT * FROM Rectangular";
$result = mysql_query($query);
closeDB($connection);
return $result;
}