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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:43:36+00:00 2026-06-08T12:43:36+00:00

I have enter code here function ajaxFunction(){ var ajaxRequest; // The variable that makes

  • 0

I have

enter code here

function ajaxFunction(){
var ajaxRequest;  // The variable that makes Ajax possible!

try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
} catch (e){
    // Internet Explorer Browsers
    try{
        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try{
            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e){
            // Something went wrong
            alert("Your browser is too old to run me!");
            return false;
        }
    }
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
    $.post('userfind.php', function(data) {


    document.getElementById("myTable").style.display = "block"; 
    var x=document.getElementById("myTable");
    for (var i = 0; i < data.length; i++) { 

    var row=x.insertRow(-1);
    var cell1=row.insertCell(-1);
    var cell2=row.insertCell(-1);
    ...
    ...

and in php

enter code here

<?php 

session_start();
$username = "XXXXXXXX";
$password = "XXXXXXXX";
$database = "XXXXXXXX";
$link = mysql_connect("localhost", "$username", "$password");
if(!$link) {echo("Failed to establish connection to mysql server");
         exit();}

$status = mysql_select_db($database);


$oId = mysql_real_escape_string($_POST["order_IDsearch"]);


if (isset($order_IDsearch)){
$result = mysql_query ("SELECT * FROM personal_info WHERE  order_id= '".$oId."' ");
$myjsons = array();
while($row = mysql_fetch_assoc($result)){ 
$myjsons[] = $row;
}
echo json_encode($myjsons);
}

?>

the javascript will show the table if i remove the SQL condition, matrk if and mark $_post

and it wont show the table if i leave the php as you see above,

whats wrong with the php page help please


here is the whole javascript ajax function,

enter code here

function ajaxFunction(){
var ajaxRequest;  // The variable that makes Ajax possible!

try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
} catch (e){
    // Internet Explorer Browsers
    try{
        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try{
            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e){
            // Something went wrong
            alert("Your browser is too old to run me!");
            return false;
        }
    }
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){




    $.post('userfind.php', {orderId:"order_IDsearch"}, function(data) {
    var obj = $("#myTable").show();
    var x = obj.get(0);
    for (var i = 0; i < data.length; i++) { 

    var row=x.insertRow(-1);
    var cell1=row.insertCell(-1);
    ...
    ...



   cell1.innerHTML = "<b><input name='edit' type='button' onClick='editRow(this)' value='Edit' />    <input name='del' type='button' onClick='delRow(this)' value='Del' /></b>";
   cell2.innerHTML =  data[i].user_id;
   cell3.innerHTML =  data[i].first_name ;
   ....
   ....  

 }},'json');}
    }
   ajaxRequest.open("POST", "userfind.php", true);
   ajaxRequest.send(null); 
    }

It’s so confusing me please help me to modify the code, should I write the code again? can this code be modified?

  • 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-08T12:43:39+00:00Added an answer on June 8, 2026 at 12:43 pm

    You are not passing anything to your php file from $.post…

    make it like

    $.post('userfind.php', {order_IDsearch: "your data"}, function(data){
    // your implementation
    });
    

    This should work…

    If your order_IDsearch is dynamic then have it done like this

    $.post('userfind.php', {yourData:order_IDsearch}, function(data){
        // your implementation
        });
    

    And on PHP side you will have to access it in

    $_POST['yourData'];
    

    To send multiple values

    $.post('userfind.php', {key1:value1,key2:value2,...}, function(data){
            // your implementation
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

enter code here I have a ListView that have a different Layout XML for
enter code here Hi All, I have a simple windows service application that connects
enter code here I have a table on SQL server 2005 with bigint primary
I have <.ImageView> enter code here s(icons) in my android layout xml file, which
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
enter code here I have the following code to build select menus dynamically: $j(#id).load('create_menu.cgi',
enter code here I have a TabControl on a Form and in the TabPages
enter link description here enter code here My problem is that the radio buttons
I have problem with synchronizing results of function I get with AJAX with that
I have some code here that is supposed change display: none to display: block

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.