Note that there are some explanatory texts on larger screens.

plurals
  1. POError in updating table fields when posting values through ajax
    primarykey
    data
    text
    <p>I m trying to update profile of student through ajax the script is runing good i get all the values passed in dataString but it is not updating the values of fields when the savebasic.php is called through ajax.</p> <p>Jscript:</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".savestudent").click(function() { var _firstname=$("#firstname").html(); var _lastname=$("#lastname").html(); var _gender=$("#gender").html(); var _location=$("#location").html(); var _aboutme=$("#about").html(); var _dob=$("#dob").html(); var dataString= 'fname='+ _firstname + '&amp;lname='+ _lastname + '&amp;gender='+ _gender + '&amp;location='+ _location + '&amp;about='+ _aboutme + '&amp;dob='+ _dob ; alert(dataString); $.ajax ({ type: "POST", url: "savebasic.php", data: dataString, cache: false, success: function(html) { alert('success'); }, error: function(html) { } }); }); }); &lt;/script&gt; </code></pre> <p>savebasic.php:</p> <pre><code>&lt;?php include_once('controller/profile.controller.php'); $profileObject=new ProfileController(); $fname=$_POST['fname']; $lname=$_POST['lname']; $gender='M'; $loc=$_POST['location']; $about=$_POST['about']; $birth=$_POST['dob']; $upt=$profileObject-&gt;updateUserprofile('59',$fname,$lname,$birth,$gender,$loc,$about); ?&gt; </code></pre> <p>if i directly pass values on savebasic.php it works . but while passing through ajax it does nothing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload