Function-php Tutorial

Source: Internet
Author: User
Tags mysql functions
Function problems call the database content, determine whether to display this information by judging whether the unix time string is greater than the current time value, ask how to write this ------ solution ------------------ it is better to judge when using data. At least less data sets are returned. ------ Solution -------------------- compare your time with time () in strtotime. Http function problems
Call the database content to determine whether to display the information by judging whether the unix time string is greater than the current time value.

------ Solution --------------------
It is better to judge when using data. At least less data sets are returned.
------ Solution --------------------
In strtotime (), compare your time with time.

Http://www.w3school.com.cn/php/func_date_strtotime.asp
------ Solution --------------------
Directly return an empty string, so you do not need to judge whether to directly connect to the string.
Return "";
------ Solution --------------------
First, is the time field of the data in your database int (10)? If yes, if the name of this field is
Time when you search for data
Select * from tbl_name where time You can try select unix_timestamp (); this is to check the current timestamp. you can solve this problem directly in the database, so you don't need to search it for judgment. If the field in your database is of the time type Y-m-d H: I: s, it will be converted.
Select * from tbl_name where unix_timestamp (time) <unix_timestamp () and .....
Conversion method:
Select unix_timestamp ("18:55:05 ");
In this way, it is better to take some time to learn mysql functions, which can save a lot of time.
------ Solution --------------------
Discussion

Reference:
In strtotime (), compare your time with time.

Http://www.w3school.com.cn/php/func_date_strtotime.asp

{Dede: SQL = "select title, arcurl from dede_archives where sortrank> time ()"}

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.