Hi all, I have this ajax script that accepts only one value at a time. I want to send more than one value to mysql for processing... but am not so good with javascript, pls point me in the right way....thanks
// auto select vehicle # and fleet #
<script>
function showFleet_Loc(str)
{
if (str=="")
{
document.getElementById("fleet_loc_Hint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("fleet_loc_Hint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","fleet_loc_select.php?q="+str,true);
xmlhttp.send();
}
</script>
Here is fleet_loc_select.php
$q=$_GET["q"];
$cd ="UPDATE vehicles SET image_file='$newimage' WHERE svreg='$q'";
mysql_query($cd);
?>