The query result of the ThinkPHP database is displayed in the form.

Source: Internet
Author: User
The query result of the ThinkPHP database is displayed in the form. the table in the database is a personal information table with a gender field. after using ThinkPHP to retrieve data from the database, how can I change the data in the table according to the result?

Male
Female

Which single queue is selected?


Reply to discussion (solution)

I am very grateful to you for your great shrimp!

Assume that the value you get is $ sex,
/> Male
/> Female

Male

Assume that the value you get is $ sex,
/> Male
/......




How to reference the $ sex variable obtained from the database on the html page is similar to {$ vo. sex}, How to reference it? Tutorial ~~~

When I saw the if tag in the ThinkPHP manual, I used it. the solution is as follows:


Male
Female

Male
Female


But what should I do if my younger brother asks for advice on how to handle prawns on the second floor?


Male

Female

IF and ELSE are provided on the second floor. I am also used to writing on the second floor, saving trouble.

6th Floor -----

Thank you for your experience.

Ox cross on the 6th floor !!!

> Male
$ Profile returned here is an array

[Quote = reference jordan102 on the second floor:]

Assume that the value you get is $ sex,
/> Male
/......




How to reference the $ sex variable obtained from the database on the html page is similar to {$ vo. sex}, How to reference it? Tutorial ~~~

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.