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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:28:16+00:00 2026-05-26T04:28:16+00:00

Hy! I am very new in Web-Dev. I have a mysql db and the

  • 0

Hy!

I am very new in Web-Dev. I have a mysql db and the controller is made with PHP.

I give the data formated in php back to the html.

My Quest:

How to parse the xml in js right for the HTML based view?

If there are better solutions for the data transfair between PHP and HMTL, please let me know.
I don’t wont the have HTML code in the php

Example PHP:

<?php
$id = $_GET['id'];
        if (is_numeric($id))
        {
            include 'db_connect.php';
            $sql = "Select * from RECIPES WHERE recipes_id=".$id;
            $result = mysql_query($sql,$db) or exit("QUERY FAILED!");

            while($row = mysql_fetch_array($result))
             {
                 echo "<RECIPE>";
                 echo "<ID>" . $row['recipes_id'] . "</ID><br />";
                 echo "<TITLE>" . $row['text'] . "</TITLE><br />";
                 echo "<TEXT>" . $row['text'] . "</TEXT><br />";
                 echo "<COUNT_PERSONS>" . $row['count_persons'] . "</COUNT_PERSONS><br />";
                 echo "<DURATION>" . $row['duration'] . "</DURATION><br />";
                 echo "<USER_ID>" . $row['user_id'] . "</USER_ID><br />";
                 echo "<DATE>" . $row['date'] . "</DATE><br />";
                 echo "</RECIPE>";
             }
        }

        else
        {
                echo "<ERROR>ID ERROR</ERRORR>";
        }
        mysql_close($db);

?>

thx

  • 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-26T04:28:17+00:00Added an answer on May 26, 2026 at 4:28 am

    If you just want to transfer data between the browser and the server then it’s simpler to use the JSON format. For PHP there are two built in function to decode and encode JSON: json_decode and json_encode.

    Modern browser support JSON by default: JSON.parse and JSON.stringify.

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

Sidebar

Related Questions

Hey I am very new to Web Programming. I have been learning PHP from
Ok so I am very new to html and the web. Right now I
Am very New to Web Page Development. In my website i have the help
I am very new to web service stuff so please be kind. I have
So I am very new to web development and have a .NET MVC site
I'm very new to web development, have many years background on the desktop, but
Hi I'm very new to web development but have a coding background. I'm trying
I'm very new to web-application programming with Java. I have two questions. First: I
I have copied a snippet of code over. I am very new to web
I am very new to web development. I am currently using tablesorter jquery plugin

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.