I am trying to print a value retrieved from a MySQL query with javascript. Here is the code
function editVal(category){
//alert(category);
//document.getElementById("editdiv").innerHTML = '<input type = text value='+category+'>';
<?
$tagquery = mysql_query("Select latitude from Zones where tag = 'category'");
while($row=mysql_fetch_array($tagquery)) { ?>
alert(category);
document.getElementById("editdiv").innerHTML = '<input type="text" value='"+<?=$row['latitude']?>+"'/>';
<?}?>
}
I know the query is working fine as I tested it before in a different form. But for some strange reason this snippet is not entering into the while loop (I tried to find it with alert function). You can have a look of the page here - http://128.233.104.33/gameview/mapv.php
I know it might be good if I would used a web service but for now just trying to solve this problem.
Any help please?