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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:58:14+00:00 2026-06-13T12:58:14+00:00

I am having a problem with the jQuery Ajax function not sending the data

  • 0

I am having a problem with the jQuery Ajax function not sending the data to the corresponding php file, and then not running the success function. Here is my js:

function meetMember(empl_id) {

var member = {id: empl_id}

$.ajax({
    type: 'POST',
    url: 'php/infocheck.php', 
    data: member, 
    dataType: 'json',
    success: function(data) {
        alert('hi');
        console.log(data);
        $('#member-info').append(data); 
    }   
});
}

And the infocheck.php code:

<?php

ini_set('display_errors',1);
error_reporting(E_ALL);

include('db-info.php');

$id = $_POST['id'];

    $q = "SELECT * FROM team WHERE empl_id = $id LIMIT 1";
    $member = mysql_fetch_assoc(mysql_query($q));
    $met = $member['ifmet'];

    if($met != 1) {
        mysql_query("UPDATE team SET ifmet = 1 WHERE empl_id = $id");
    }

    echo "<img src=\"game/images/{$member['image']}\" alt='' style='padding:2px 10px 0px 0px; float:left;' />";
    echo "<h3>{$member['name']}</h3>";
    echo "<h4><em>{$member['title']}</em><h4>";
    echo "<p>{$member['description']}</p>";

?>

When I view the php file in the browser, I get the errors:

“Notice: Undefined index: id in /Applications/MAMP/htdocs/Development/ETL24/php/infocheck.php on line 8

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/MAMP/htdocs/Development/ETL24/php/infocheck.php on line 12″

The console.log and alert in the success function do not run. I do not even get the echo in the console when I view the php file. Please let me know of any ideas or questions you might have. 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-06-13T12:58:15+00:00Added an answer on June 13, 2026 at 12:58 pm

    Use dataType: 'html' your file return HTML

    When your open the file on browser(GET) yes you get a Error because it need to pass the id by POST.

    if you want to debug it change to type: GET and on the url append ?id=1

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

Sidebar

Related Questions

I'm having a problem similar to jQuery $.ajax Not Working in IE8 but it
I am having problem with jquery that the ajax call is not made. Also
I am having a problem with a simple callback function in jQuery ajax. Google
The following code is having some problem with the jQuery. <script type="text/javascript"> $(window).load(function() {
Here's an interesting problem: I have some jQuery that looks like this: $(document).ready(function() {
I am having problem with my jQuery function what I am trying to achieve
I'm having a problem with connection AJAX with PHP. The main goal is to
Our app handles all users information via AJAX using jQuery. We return data.success or
I'm having a problem where the data object passed to my complete() callback function
i am having a strange problem, while calling ajax jquery in asp.net.. i am

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.