Birthday, gender, address storage and reading (select mode !) -Php Tutorial

Source: Internet
Author: User
Ask how to store and read Birthday, gender, and address (select mode !) This post was last edited by okgef from 2015-01-21:50:11. for example, if the birthday is & nbsp; how to automatically restore the post to & lt; select & gt; & lt; option & nbsp; selected & gt; 1990 & lt; opti ask how to store and read Birthday, gender, and address (select mode !)

This post was last edited by okgef from 10:50:11

For example, how to automatically restore the data 1990Other years 01Other months 11Other days
Gender: 0 (Confidential ), Confidentiality, Male, Female
Address: gd755 (Shenzhen city, Guangdong province) restored GuangdongOther provinces ShenzhenOther cities

------ Solution ----------------------
1. retrieve records from the database
2. assign the record result set to the array
3. write all form items
4. assign values in the array to the form.
------ Solution ----------------------
Example:

$ Conn = mysql_connect ('localhost', 'root', 'flash') or die ('server connection failed ');
$ Select = mysql_select_db ('test', $ conn) or die ("database connection failed ");
$ Query = "select * from stu ";
Echo'';If ([email protected] _ query ($ query )){$ I = 0;While ([email protected] _ fetch_array ($ result )){Echo"$ Rows [name]";$ I ++;}Mysql_free_result ($ result );Echo'';
} Else echo "failed to execute SQL statement ($ query):". mysql_error ();
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.