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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:56:53+00:00 2026-05-24T20:56:53+00:00

i have mysql database for i fetch information using json for example: $sql =SELECT

  • 0

i have mysql database for i fetch information using json
for example:

$sql ="SELECT * FROM parent WHERE id = '$name'";       
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
 {
$abc=$row[id];
}
echo json_encode($abc)

Now how can i display this json encoded element in my main html file using jquery?
what i want to do is based on this fetched element i want to do some if else operation.

for example:

if(value of row[id](should be achieved using jquery) ==null)
{}
else
{}

I am looking for something like $(xxxx).somefunction()
Thanks in advance.

  • 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-24T20:56:53+00:00Added an answer on May 24, 2026 at 8:56 pm

    You could use jQuery to convert the JSON into a JavaScript object and then add the properties of the object into your html.

    jQuery.parseJSON( json )
    

    Add the JSON from the database to your webpage through:

    echo "var myJson = ".json_encode($abc);
    

    Then use jQuery to parse the JSON through:

    myObject = jQuery.parseJSON(myJson);
    alert(myObject.id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code which retrieves information about players from a MySQL database. I want
I'm retrieving information about resources from a MySQL database using PHP. The information about
I have a MySQL database table containing information about places. I'm trying to fetch
i am trying to select information from my mysql database with this statement after
I have a CSV export script (enrdata_arch.php) which calls information from an existing database
I have a mysql database table to store country name and currency symbol -
I am creating an update form where previously submitted information from a mysql database
I use table to fetch cars information from my database and each column in
I would like to submit information to a mySql database using php and ajax.
I have a table created with PHP from an Sql Database that successfully displays

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.