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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:33:49+00:00 2026-05-25T15:33:49+00:00

I am using the JQuery .post method to get data using an AJAX call.

  • 0

I am using the JQuery .post method to get data using an AJAX call. The PHP file that is rendering the data has the following code that inputs information into a database:

$query = "INSERT INTO  questions(question, added_by) VALUES ('$question', '$user_id')";   

 $result = mysql_result($query); 

        //If db error
        if(!$result )
        {
            $error = str_replace("'", "*", mysql_error());
            $method = __METHOD__.'line: '.__LINE__; 
            return Error::db_error($method, $error, $this->ip, 'An internal error has occurred.  Your question can not be added at this time.');
         }

According to this code, a database error is occurring, yet mysql_error() is blank. When I use die($query), and copy and paste the literal query string into my mysql gui window (sqlyog) and run the query, it inserts just fine with no warnings or errors.

I have this general set-up for some other PHP functions and it works just fine.

I am really stumped by this. Any help would be greatly appreciated. Thanks.

  • 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-25T15:33:50+00:00Added an answer on May 25, 2026 at 3:33 pm

    Execute the query using mysql_query before Retrieving the contents of cells from a MySQL result set using mysql_result.

       $result = mysql_query($query); 
       echo mysql_result($result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that I can call a page method with jquery using the following
I am using this code if form.is_valid(): form.save() if request.POST.get('ajax') == 'true': return HttpResponse('Data
I'm using jQuery to post a form to a php file, simple script to
I am using jQuery to make a POST to a PHP file with the
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I'm trying to submit a simple jQuery ajax call but using the DELETE method
When using jQuery 's ajax method to submit form data, what is the best
I'm trying to call an asp.net method using jquery/ajax from a button click on
i call my asp.net page method like below code $.ajax({ type: POST, url: MyPage.aspx/GetItems,
I am using JQuery to post with AJAX to another ASP page. Do I

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.