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 9189371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:13:18+00:00 2026-06-17T20:13:18+00:00

I’m running an AJAX call that passes some variables to a PHP script which

  • 0

I’m running an AJAX call that passes some variables to a PHP script which is supposed to INSERT into a table. For reasons that are unbeknownst to me, is it not.

The AJAX call gets a success, so presumably to problems there.

$('#rate_button').click(function(){
var varate = $('#u_varate').val(),
    fharate = $('#u_fharate').val(),
    usdarate = $('#u_usdarate').val(),
    conv15rate = $('#u_conv15rate').val(),
    conv5rate = $('#u_conv5rate').val(),
    conv20rate = $('#u_conv20rate').val();

$('#varate').val(varate);
$('#fharate').val(fharate);
$('#usdarate').val(usdarate);
$('#conv15rate').val(conv15rate);
$('#conv5rate').val(conv5rate);
$('#conv20rate').val(conv20rate);
var rates = $('#rates').serialize();
    rurl = 'http://www.nexthometown.com/components/com_singleprop/views/singleprop/tmpl/scripts/rates.php?' + rates;

$.ajax({
    url: rurl,
    success: function(){
       $('#success').fadeIn(500).delay(500).fadeOut(500); 
    },
    error: function(){
        alert('Oopsy!');
    }
});
});

The PHP script called by the AJAX function. I don’t get an error callback from AJAX, so I guess this runs ok?

<?php
$link = mysql_connect('localhost','user','pass');


$varate = $_GET['varate'];
$fharate = $_GET['fharate'];
$usdarate = $_GET['usdarate'];
$conv15rate = $_GET['conv15rate'];
$conv5rate = $_GET['conv5rate'];
$conv20rate =  $_GET['conv20rate'];

$query = "INSERT INTO singleprop.jos_rates(varate, fharate, usdarate, convfifteen, convfive, convtwenty)VALUES('" . $varate . "', '" . $fharate . "', '" . $usdarate ."', '" . $conv15rate . "', '" . $conv20rate . "');";

$result = mysql_query($query);

mysql_close($link);
?>

Also, when I run the script itself in the browser and had it echo the valiables, Everything ran fine.

When I copy the INSERT argument and but it in a CMD with proper values, it works fine.

  • 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-17T20:13:19+00:00Added an answer on June 17, 2026 at 8:13 pm

    The problem is that your sql has 6 fields but only 5 values given. You are missing $conv5rate.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to create an if statement in PHP that prevents a single post
I am currently running into a problem where an element is coming back from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.