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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:38:25+00:00 2026-05-24T15:38:25+00:00

I am building a php page something like this .. A jquery syntax decleration

  • 0

I am building a php page something like this ..

A jquery syntax decleration

<script type="text/javascript" src="jquery.js"></script></script>
<script type="text/javascript">
function get(){
$.post('output.php', { name: form.name.value },
function(output) {
$('#age').html(output).show();
}) ;
}
</script>

The form structure .
The information of the id entered here will be fetched from a database using output.php file

<body> 
<p>
<form name="form">
id:
<input type ="text" name="name"><input type ="button" name="Submit_1" 
value="Get          
Existing Data" onclick="get();">
</body>

Output.php echos the following values from the database which will be displayed on the same page using jquery & ajax

$age= mysql_query("SELECT title FROM parentid WHERE id ='$name'");
$age_num_rows = mysql_num_rows($age);   
if ($age_num_rows==0)
echo "id does not exist";

else
{
$sql ="SELECT * FROM parentid WHERE id = '$name'";       
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
$abc_output= "Existing data of the record <br />";      
$abc_output .="Title: " . $row['title'] . "<br />" ;
$abc_output .="Report No: " .  $row['reportno'] . "<br />" ;
$abc_output .="URL: " .  $row['calc_url'] . "<br />" ; 
$abc_output .="Institution: " .  $row['institution'] . "<br />" ; 
}
}
echo $abc_output;

The output of the above program will be something like

Form structure for id:

After entering id info of title,report no. ..will be displayed on the same page

..

Now what i want to do is

I will be creating the form structure for title , etc.,
something like this..

<p>title:<input type="text" name="title"/></p>     

<p>reportno:<input type="text" name="reportno"/></p>

 <p>url: <input type="text" name="calc_url"/></p>

The information that is obtained from the database should be inserted into these forms ..these forms will be on the initial page..

How can i do this??

Thanks for u r time..

  • 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-24T15:38:26+00:00Added an answer on May 24, 2026 at 3:38 pm

    I suggest you create an associative array to hold the values you’re returning rather than appending the strings. You can encode that object as JSON using json_encode. http://www.php.net/manual/en/function.json-encode.php

      $output = array("name" => "john");
      echo json_encode($output);
    

    then you can access the array by the key in javascript. Something like..

    $('#name-textbox').val(output.name);
    

    where “output” is the json object you returned.

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

Sidebar

Related Questions

I am working on building a small php/mysql script that will act something like
I'm building a webapp using php, ajax, javascript, mysql. I've been worring about something
I'm building a PHP page with data sent from MySQL. Is it better to
I'm building a PHP page that will load some off site content into a
I'm working on building a PHP based proxy script to access a particular ASP.NET
I'm building a website with xhtml, css, jquery, php and mysql. In one of
I building a simple, 7 page, database driven, website, and I would like to
I am building a website using php+mysql. I have a registration page and its
I am currently working on a building community website in PHP. This contains forms
I have made a Web page using jquery and php where all files are

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.