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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:45:42+00:00 2026-05-30T17:45:42+00:00

I have json_encoded an array of a mysql result as shown here: $allquery=SELECT *

  • 0

I have json_encoded an array of a mysql result as shown here:

$allquery="SELECT * FROM wp_users";
$names = array();   
$allresult=mysql_query($allquery) or die(mysql_error()); ?>

<?php while($rows=mysql_fetch_array($allresult)){  

  $names[] = $rows['display_name']; 

}

print json_encode( array( 

  "res" =>  $names,
  "fvdfvv" => "sdfsd"

) 
);

My problem is… when it gets back to the client-side, I am unsure about how to display it. I try and alert the reply on success:

  success: function(result){
            var allresult = result.res
            $('#result').html(  allresult  );

            alert(allresult);
        //$("#notice_div").hide(); 

      }

But this doesnt return anything. In fact, the success handler doesnt even begin.

Any ideas?

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-30T17:45:44+00:00Added an answer on May 30, 2026 at 5:45 pm

    I would check your making a JSON request with your request call, I know mootools can be funny about that not sure what framework your using is it jQuery?

    I would use echo instead of print (buts thats my preference)

    Do you get any results at all? have you alerted out “result”?

    if your definitely sure the success handler isn’t firing, the problem is elsewhere. Perhaps you can expand your post with more of your code.

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

Sidebar

Related Questions

Here is my code: $result = mysql_query(SELECT * FROM Product_Characteristics); $charact_array = array(); while($row
i have a json data retrieved from data base i.e $result=array(); $query=SELECT * FROM
I have a select field. I must fill with options taken from a mysql
So I have this function that takes all the users from an MySql table
I have the following PHP function which will list the users from a MySql
I have no trouble at all outputting MySQL data to an array then encoding
Okay I have been racking my brain trying to build a JSON array from
I have a PHP script that selects some data from mysql and throw it
I have the following PHP that creates some JSON from a MySQL query. This
i have this code $md_query = SELECT * FROM table ORDER BY id ASC;

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.