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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:25:29+00:00 2026-05-21T22:25:29+00:00

How do I populate several text input fields with corresponding data, executing php-mysql query

  • 0

How do I populate several text input fields with corresponding data, executing php-mysql query script once only?
e.g.

<form name="video" action="mysql.php" method="post" enctype="multipart/form-data" target="videofrm">
                <p>
                    <label for="url">url/gallery:</label><input class="text" type="text" id="url" name="url"/>
                    <input id="favorite" class="text" type="checkbox" name="favorite" value="true"/>
                    <label for="favorite" class="noneFloat">favorite</label>
                </p>
                <p>
                    <input id="thumb" type="file" name="thumb"/>
                </p>
                <p>
                    <label for="title">title:</label><input class="text" type="text" id="title" name="title"/>
                </p>
                <p>
                    <label for="desc">description:</label><input class="text" type="text" id="desc" name="description"/>
                </p>
                <p>
                    <label for="country">country:</label><input class="text" type="text" id="country" name="country"/>
                </p>
                <p>
                    <label for="categories">categories:</label><input class="text" type="text" id="categories" name="category"/>
                </p>
                <input type="button" value="fetch" id="fetch"/>
                <input type="reset" value="clear"/>
            </form>

I need to populate input text fields with:

select url,title,desc,country,category
from video where url='something';

First I need to know how to write this kind of php script so it returns json datatype, and afterwards how to populate text input fields, using jquery, with returned data.

`many 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-21T22:25:31+00:00Added an answer on May 21, 2026 at 10:25 pm

    Your question is very broad, and looks a bit like a “please write my code” request (although it wasn’t necessarily one). Try to avoid that impression, and mention what you have already tried/researched to avoid downvoting.

    Some pointers:

    • Use json_encode() to get mySQL result data into JSON form on PHP side

    • Send the correct content-type header to go with it: header("content-type: application/json");

    • Use jQuery’s getJSON() shorthand (or .ajax() with a json dataType) to fetch the script

    • Populating the input fields with the data is trivial using .val().

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

Sidebar

Related Questions

I have... a dynamic populated select box several input boxes a submit button form
I have a combo box and several text boxes on a form. When I
I have several textfields which will populate a text area. I managed to populate
I am trying to populate a text box with some data, namely the names
I have a structure which I need to populate and write to disk (several
Or do you populate your form controls manually by a method? Is either considered
After writing code to populate textboxes from an object, such as: txtFirstName.Text = customer.FirstName;
I have several ASP:TextBox controls on a form (about 20). When the form loads,
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but
I have a product_table with a product_id among several other fields. I am creating

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.