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

  • Home
  • SEARCH
  • 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 7666695
In Process

The Archive Base Latest Questions

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

I currently have code which will pull the first element from a database record

  • 0

I currently have code which will pull the first element from a database record and print it in an output box.

What is the easiest way to print the rest of the elements of that record to the other relevant output boxes?

My PHP file takes an ‘id’ specified by the user.

$id = $_POST['id'];

$query = "SELECT * FROM Customers WHERE ID = $id";
$result= mysql_query($query);
if (mysql_num_rows($result) > 0) { 
while($row = mysql_fetch_row($result)) {

    echo $row[1];

 }
}

And this is the code in the HTML file

jQuery(document).ready(function(){ 
jQuery("input.myid").keyup(function(e){ 
    e.preventDefault(); 
    ajax_search(); 
 }); 
});

function ajax_search(){
var search_val=jQuery("input.myid").val(); 
jQuery.post("find.php", {id : search_val}, function(data){
 if (data.length>0){ 
 jQuery("input.fname").val(data); 
  } 
 }); 
}

The code takes the id (‘myid’) and prints to a text box named ‘fname’.

  • 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-31T14:53:57+00:00Added an answer on May 31, 2026 at 2:53 pm

    I find it easier to json_encode the whole thing (record I mean) and use something like jquery.populate which basically takes an object and fills a form with it (all fields it can find which names’ match properties from the object).

    I hope this makes sense.

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

Sidebar

Related Questions

I currently have this code which reads the first field in a database record
Currently we have a table with a bunch of data from a database which
I'm currently writing some code which will download images from my web server for
I currently have some code which iv used to export a table from the
I have this following code which will return all the current semesters. How do
I currently have some code which when you press the submit button, a marker
I currently have code in objective C that can pull out an integer's most
I currently have some code that will produce a crash dump when my application
I currently have this line of code which I want to work in all
I have some code that references an outside DLL which in production will be

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.