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

  • Home
  • SEARCH
  • 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 6549201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:03:52+00:00 2026-05-25T12:03:52+00:00

I have four variables I’m trying to pass via AJAX to be processed by

  • 0

I have four variables I’m trying to pass via AJAX to be processed by some PHP on the same page: newJudgeName, newJudgeSection, newJudgeStatus, and originalJudgeName. The success function echos them out and they’re the correct values, it’s just the newJudgeStatus variable is not being picked up by my PHP. I’ve switched newJudgeStatus with newJudgeName in the data line on the AJAX request and then the value is sent just fine (I can see it in the db under Judge Name)… it’s only when it’s in the original spot in the ajax request that it doesn’t work. I’m completely new to Ajax. Any help would be much appreciated.

AJAX:

    $.ajax({   
        type: "POST",   
        url: "test.php",   
        data: 'newJudgeName=' + newJudgeName + '&newJudgeSection=' + newJudgeSection + '&newJudgeStatus =' + newJudgeStatus + '&originalJudgeName=' + originalJudgeName,
        success: function(){
            alert('newJudgeName=' + newJudgeName + '&newJudgeSection=' + newJudgeSection + '&newJudgeStatus =' + newJudgeStatus +'&originalJudgeName=' + originalJudgeName);
        }
    });

PHP:

if(isset($_POST['newJudgeName'])){
        $newJudgeName = $_POST['newJudgeName'];
        $newJudgeSection = $_POST['newJudgeSection'];
        $newJudgeStatus = $_POST['newJudgeStatus'];
        $originalJudgeName = $_POST['originalJudgeName'];
        $judgeID = judgeNametoID($originalJudgeName);
        $con = mysql_connect("-","-","-");
        if (!$con)
          {
          die('Could not connect: ' . mysql_error());
          }
        else {
            // connected to database successfully
        }
                    mysql_select_db("cm", $con);
        $query = ("UPDATE `casemanagers`.`judges` SET `Name`='$newJudgeName' , `Section`='$newJudgeSection', `Active`='$newJudgeStatus' WHERE `judgeID`='$judgeID';");
        $result = mysql_query($query);
        mysql_close($con);
}
  • 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-05-25T12:03:53+00:00Added an answer on May 25, 2026 at 12:03 pm

    You have an errant space in your data string:

    '&newJudgeStatus =' + newJudgeStatus +
    ---------------^^^^
    
    // Should be
    '&newJudgeStatus=' + newJudgeStatus +
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some variables I want to change via GUI. The variables are of
I have four classes which share some arrangement of four properties. I have currently
I have four variables of type integer - var tip_1, tip_2, tip_3, tip_4; The
I want to conduct a POST request via jQuery. Say I have four Javascript
I have the following php script that is called by jquery ajax function report_range($time,
How can I change colors of elements using variables? Let's say we have four
Using before_create to see if the record exists. Have four variables/columns (alpha, beta, delta,
I have four session variables-- location = request.session['location'] computer = request.session['computer'] phone = request.session['phone']
I have four elements on a page, elements 1 - 4 in that order
On my website I have four custom variables. My issue is that Google Analytics

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.