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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:23:30+00:00 2026-06-05T13:23:30+00:00

I’m a beginner in jQuery area and I have simple question like this :

  • 0

I’m a beginner in jQuery area and I have simple question like this :

I want to load (AJAX) MySQL result in array, let’s say :

$row[0] = first name
$row[1] = last name
$row[2] = phone number

I have no problem with PHP part, but I have difficulties to display each of that array content on different id. because syntax I found loads everything processed by PHP :

<script type="text/javascript">
$(document).ready(function(){
    $('#mysql-result').load('ajax.php');
});
</script>

how to get ‘First Name’, ‘Last Name’ and ‘Phone Number’ from PHP with only one time load and still I can put the result in different . thank you.

UPDATE

I give you real example about what I need. Here’s my HTML file named ajax.html :

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ajax Trial</title>
</head>

<body>
<div id = "fistname"><!-- ajax result goes here --></div> 
<div id = "lastname"><!-- ajax result goes here --></div>
<div id = "phonenumber"><!-- ajax result goes here --></div>
</body>
</html>

and here’s my PHP file, named ajax.php :

<?php
require_once 'config-min.php';
$con = mysql_connect($DbServer,$DbUser,$DbPassword);
mysql_select_db($DbName, $con);

$result = mysql_query("SELECT FirstName, LastName, PhoneNumber FROM User WHERE ID = '201' LIMIT 1");
$row = mysql_fetch_array($result);

echo $row[0];
echo $row[1];
echo $row[2];

mysql_close($con);
?>

now, my question still same… how to get this PHP result (3 echos), load once, then displayed in those 3 different divs

  • 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-05T13:23:32+00:00Added an answer on June 5, 2026 at 1:23 pm

    I too wanted to do something like you wish to.And I did the following code and It worked. Hope this helps you too.

     <script type="text/javascript" src="/jquery.js"></script>
    <script>
       $(document).ready(function(){
     $("#form_plat").submit(function(e){
    
        var str = $(this).serialize();
        row[0]=$('#First_name').val();
        row[1]=$('#last_name').val();
        row[2]=$('#phonenumber').val();
    
        $.ajax({
                type: "POST",
                url : 'Insert_Into.pl', //if you wish to store in database
                data : {'firstname_name':row[0],'last_name': row[1],'phonenumber':row[2]},
                beforeSend: function() {
    
                    console.log("hey i am here");                   
                },
                success: function(){
                         $('#note').html('Thank you for your submission!');
                         $('#note').hide();                     
                         $("#fields").fadeOut('slow');
                }
             });
    
        return false;
    
      });
    
     });
    
     </script>);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.