1 in the SQL statement you can add a restriction condition: Left (text,20) only the first 20 words of the text;
2 can be used as pagination using limit FromRecord, recordnum, for example, limit 0,30 indicates that 30 records are traversed from the first record;
The 32-table connection can be: Table1 join table2 using X (x is a common field for two tables), or table1 join table2 on table1.x = table2.x
4 PHP Access querystring can be $page = $_get[' ' page '];
Or
$page = $_request[' ' page '];
Which request can obtain post,get,querystring and other characters;
Before that, I saw a more stupid way:
Parse_str ($_server[' query_string '), $output); First, save the query string into an array $output
$page = $output ["]; And then indexed by variable name
5 The comparison of date functions in PHP is actually a string comparison;
6 The date type data in MySQL can be: 2000-02-03,2002.02.03,2002.2.3,02.02.03,02.2.3, which means there must be a month and a day, and must be " Apart.
7 data () to get the time zone problem, I found that the time is less than 8 hours, because php.ini inside the default configuration is GTM U.S. time zone;
WORKAROUND: You can modify the php.ini:
[Date]
; Defines the default timezone used by the date functions
Date.timezone = "Asia/shanghai"
Alternatively, use the date () function plus date_default_timezone_set ("PRC");
81 time, debugging in the body always said I was missing ")", the cost of a half-day is intval ($_post[' ' Consumetype ' "]) problem, in the database the field is varchar (50), I don't use the Intval function in the Zengsong table because its ID is 1,2 ... integers and char can convert to each other, but in the other two tables it's a5a,sp07-01, but how does it convert to int?
Let's look at the declaration of the Intval function:
The Intval function is used to get the integer value of the variable: int intval (mixed var [, int base])
Returns the integer value of the variable var by using a specific binary conversion (the default is decimal).
var can be any scalar type. Intval () cannot be used for array or object.
9 Another inexplicable problem, with user name 1 login can be, change a ' ' Bo ' "Landing, the system is in place error: Said I run time error: Missing" ", Nnd. Check that the variable type in the SQL statement is inconsistent with the database,
In PHP when you convert from floating-point numbers to integers, the digits are rounded up (drop decimal places).
11 in the MySQL INSERT statement, if the self-added field is to be replaced with (NULL).
PHP in Chinese garbled??? Problem solving:
After mysql_connect, add the mysql_query ("Set Names" "gb2312");
Or the full use of UTF8 code, you do not have to add the above statement.
There is also function Iconv ("GBK", "UTF8", "string"), which enables the conversion of various character encodings