I'm not sure exactly what is going on here or how to problem solve this but I have some code in php
ECHO "<TD WIDTH='" . $NAV_PN_ColWidth . "' style='border-left: solid #000000 1px; border-bottom: solid #000000 1px; text-align:center;'><input name='nav_pn".$EmptyRows."' type='text' id='nav_pn".$EmptyRows."' value='' size='12' style='font-family:Tahoma,Arial,Helvetica,Geneva,sans-serif; font-size:small; text-align:center; border: 0 none;' onblur='this.value=this.value.toUpperCase()'/></TD>\n";
and if someone updates the nav_pn input it will submit a new record into a MySQL database by using the following
$("#nav_pn<?php echo $JavaCnt2;?>").change(function(){
var nav_pn = $('#nav_pn<?php echo $JavaCnt2;?>').attr('value');
var username = '<?PHP ECHO $UserName;?>';
//alert("value=nav_pn&nav_pn="+ nav_pn + "&user=" + username)
$.getJSON('AJ_Update.php', {'value' : 'nav_pn', 'nav_pn' : nav_pn,'user' : username}, parseInfo);
function parseInfo(data){}
window.location='<?php echo $_SERVER["PHP_SELF"]."?usid=".$_GET['usid'];?>';
}
);
and here is my code from AJ_Update.php
if($_GET['value'] == "nav_pn"){
mysql_query("INSERT INTO TBLTRANSFERS (nav_pn, user, crt_ts, mod_ts, email, ext, user_id) VALUES ('".strtoupper($_GET['nav_pn'])."', '".$_GET['user']."','". $timenow ."','". $timenow ."',(SELECT b.emailaddress FROM tblusers b WHERE b.username='".$_GET['user']."'),(SELECT b.extension FROM tblusers b WHERE b.username='".$_GET['user']."'),(SELECT b.user_id FROM tblusers b WHERE b.username='".$_GET['user']."'))");
}
My problem is that sometimes this works beautifully and sometimes it doesn't. I can't figure out why. When I do an alert it seems like its grabbing all the values, the only thing I can figure is that the code in the AJ_Update.php is not working for some reason. Any thoughts?