I am new to php and javascript...
I know js is client side n php is server side
but I want to pass value of variable x to $res
i tried using AJAX but i cant get the result..
Please help..
<SCRIPT LANGUAGE="JavaScript">
...
var x=0;
for (var i = 1; i < po; i++) {
if (Pr[i]['kRs'] == 'pSt') {
x++;
}
...
</SCRIPT>
<?php
$res=
$con = mysql_connect("localhost", "root", "root");
if (!$con) {
die("Database connection could not be established" . mysql_error());
}
$db_select = mysql_select_db("jaka", $con);
if (!$db_select) {
die("Database could not be selected" . mysql_error());
}
$bha=$_uid=$_SESSION['username'];
mysql_query("UPDATE user_info SET extra3='$res' WHERE username='$bha' ");
?>