answersLogoWhite

0

Working at hostmysite.com gives me a lot of experience with PHP and mysql. All you need to do is use a mysql query to grab information from a database. From there you can enter easily use the returned data to a form. Here is an example:

<?php

$query = sprintf("SELECT firstname, lastname, address, age FROM friends LIMIT 1");

$result = mysql_query($query);

if (!$result) {

$message = 'Invalid query: ' . mysql_error() . "\n";

$message .= 'Whole query: ' . $query; die($message);

}

while ($row = mysql_fetch_assoc($result)) {

$firstname = $row['firstname'];

$lastname = $row['lastname'];

$address = $row['address'];

$age = $row['age'];

}

echo ' <form method="post">

<input name="firstname" value="'.$firstname.'">

<input name="lastname" value="'.$lastname.'">

<input name="address" value="'.$address.'">

<input name="age" value="'.$age.'">

</form> ';

mysql_free_result($result);

?>

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Where can someone find more information about the php mysql tutorial?

One can find more information about the php mysql tutorial on Tutorials Point, Tizag, and W3 Schools. More information about the php mysql tutorial can be found at Site Ground.


How can i Have php post to self with mysql?

Mysql is an Database where Data from HTML forms will be inserted to it by some scripts like ASP 3 (classic), ASP.NET, PHP, ColdFusion and... What you need is a form (By HTML), an Database and table in Mysql and PHP to insert data from your form to the table. mysql insert command is: INSERT INTO table_name_here (column1, column2, ..) VALUES (value_of_column_1, value_of_column_2, ...)


What are good Mysql Php sites?

Mysql PHP is a programming language that is supposed to help with finding specific information in a database. ScriptBase is one of the leading developers and producers of this type of software.


Which mysql product is suitable for php connection?

mysql client library


What has the author Janet Valade written?

Janet Valade has written: 'PHP &amp; MySQL' 'PHP &amp; MySQL web development all-in-one desk reference for dummies' -- subject(s): Computer Technology, Nonfiction, OverDrive, PHP (Computer programming language), SQL (Computer program language), Web site development 'PHP et MYSQL' 'PHP and MySQL for Dummies'


Who can design your website in PHP and MySQL?

Any of the millions of web developers using PHP and MySQL around the world. Either that or teach yourself!


What do I need to do to make PHP and MySQL work together?

Both are Open-source and free. The combination of PHP and MySQL gives unmet options to create just about any kind of website - from small contact form to large corporate portal.


Can you run PHP and MySQL on Linux?

Yes.


How do you develop software using PHP and MySQL?

how do u develop software using php and mysql?


How are PHP and MySQL compatible?

By sending messages to the MySQL server, you can communicate with the database. To submit SQL queries to the database, you use PHP functions. You don't need to know how to communicate with MySQL because PHP takes care of that. You only need to be familiar with SQL queries and PHP functions. To learn more about data science please visit- Learnbay.co


What are the advantages and disadvantages of PHP with mysql?

Ultimately PHP is a programming language and MySQL is a database language. Using PHP with MySQL is a nice combination with built-in support and the simplicity of it all. However, there aren't a lot of disadvantages of using PHP with a database, it just allows for better data organization and whatnot. There are definitely advantages and disadvantages to using a database other than MySQL (such as MongoDB or PostgreSQL).


Why are you required to use a MySQL database in PHP?

You don't. PHP does not required MySQL to function. But because PHP is one of the easiest language with more built-in functions than you would ever need, and MySQL is free and easy to manage; people often use them together :)