Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:16:04+00:00 2026-06-09T00:16:04+00:00

I have a simple form which updates values in the db via ajax call

  • 0

I have a simple form which updates values in the db via ajax call to another page and returns success message and loads values. Each page determines which record to update via querystring (ie index.php?clientid=2).

For some reason, when my ajax call returns and reloads, it is losing the querystring value and getting set to default, clearing it so that the following php part of the code no longer gets it:

<?php if(isset($_GET["clientid"])) {
        $clientidstring = $_GET["clientid"];
        } else {
        $clientidstring = 1;
        }

        $sql = mysql_query("select * from profiles where id=" . $clientidstring);
        $row = mysql_fetch_array($sql); ?>

So what happens on update is that clientid “1” is always being returned instead of current url querystring value for it (which still shows in the URL field in the browser btw).

DB is updating fine, and with the correct record. And if I reload the page entirely, it will show the correct values. The only problem seems to be the ajax callback clearing the url parameter that is used in the db call.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:16:06+00:00Added an answer on June 9, 2026 at 12:16 am

    Ok, I figured this out. For anyone who this may help, it turned out that when reloading my changes, I needed to pass the querystring in the partial jQuery.load, so this:

                             $('#s_aname').load('index.php #sub_aname');    
    

    gets changed to this:

                             $('#s_aname').load('index.php?clientid='+clientid +' #sub_aname'); 
    

    And now, all is well. Thanks to anyone that read this and tried to help, I probably was not as clear as I should have been.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form at my site which sends it data via Ajax
I have simple form like this which accepts only two values string action and
I have a simple form which I would like to submit (i.e fire ajax)
I have this simple form which shows a pop up calendar when clicked on
I have a simple modal form which I'd like to close when Esc is
I have a simple html login form which is validated with javascript before its
I have written a simple CRUD form which has one select list. However the
I have a simple Ruby on Rails form which includes an authenticity_token. Unfortunatly, I
I have a simple MVC form with the following elements: <%= Html.TextBox(FechaInicio) %> Which
I have two simple submit buttons on my form, which work just fine: <button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.