ipwnzphp Posted July 30, 2009 Share Posted July 30, 2009 I am using thjis ajax code but its not posting to my database, the function is being called fine. but its just not posting to the db. function userTyping() { receiveReq.open("POST", 'getChat.php?chat=1&typing=1', true); var param = 'action=typing'; receiveReq.send(param); } here is the php code it is calling // User is typing storage! if($_POST['action'] == 'typing') { $sql = "INSERT INTO simp_live_typing_status (s_id, typing) VALUES (" . db_input($_POST['sid']) . ", '1')"; db_query($sql); } Link to comment https://forums.phpfreaks.com/topic/168065-ajax-mysql-update-not-posting-help/ Share on other sites More sharing options...
phpSensei Posted July 30, 2009 Share Posted July 30, 2009 try this function userTyping() { receiveReq.open("POST", 'getChat.php?chat=1&typing=1', true); receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); param = "action=typing"; receiveReq.send(param); } Link to comment https://forums.phpfreaks.com/topic/168065-ajax-mysql-update-not-posting-help/#findComment-886745 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.