RE: Help with Updating database from PHP? 07-28-2016, 06:40 AM
#21
(07-28-2016, 05:52 AM)mudrig Wrote: That worked. Looks like I just had the parameters backwards on that.
Now one more question since you have been so helpful. How would I make this form after submitted go back to same page and Display above form the result from the action of the form submit.
Awww yeah
That's great...In order to do that you'll have to submit the page via Ajax, I haven't tested the code but here it is according to your form
Code:
<script type="text/javascript">
$(document).ready(function() {
   $('form').submit(function(e){
   Â
      $.ajax({
        type: 'post',
        url: 'user_rank_change.php',
        data: $('form').serialize(),
        success: function(result) {
            alert(result);
        }
      });
      e.preventdefault(); //Doesn't allow page to refresh
   });
});
</script>Paste this code after your </body> tag and tell me if any error comes or it works


![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)