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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:18:51+00:00 2026-05-28T04:18:51+00:00

link I would like to insert data in mysql db through ajax. I have

  • 0

link

I would like to insert data in mysql db through ajax. I have follow the apporach in the list,however, it doesn’t mention what i should do in the php part. In this example it only show

var queryString = $.param(formData); 

    // jqForm is a jQuery object encapsulating the form element.  To access the 
    // DOM element for the form do this: 
    // var formElement = jqForm[0]; 

    alert('About to submit: \n\n' + queryString); 

and a string of the input value is obtained, how can i retrieve them in my mysql page?thankyou
Also, i notice that when i combine this with jquery form validation plugin, the form will submit before check , i know there is an option to halt the submit, but is there any code to let the ajax know the code is vaildated?
thank you !

  • 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-28T04:18:52+00:00Added an answer on May 28, 2026 at 4:18 am

    You can use an if statement to validate the data from your form, then if it returns valid data, it can run the the ajax request with the query string. As for the PHP, depending on your method of sending the variables, you can either use:

    $var = $_GET['var1'];
    $var = $_POST['var1'];
    $var = $_REQUEST['var1'];
    

    You should also make sure that you are validating and escaping all of your variables in your php script before you insert them into your database to prevent injection.

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

Sidebar

Related Questions

I have a href link and I would like it to be clicked when
I have couple of statements, the pseudo code would look something like this: insert
I would like to insert some test data while I start my application after
I would like to put a link to a webpage in an alert dialog
I would like to construct an HTML link element referencing a CSS file and
I would like to replace the default malloc at link time to use a
I would like to change the target of symbolic link from within a bash
I would like to know how the recycle image link works, it points to
In our application, we would like to make a link to an online help
In my web app, I would like to show an Admin menu link only

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.