Let's look at the code below.
The code is as follows
Copy Code
Set conn = Server.CreateObject ("Adodb.connection")Conn.Open "Driver={mysql ODBC 3.51 DRIVER}; Server=127.0.0.1;database=shops; User=root; password=xxx; "
PHP MySQL Data Deletion Delete
The DELETE statement is used to record the deletion table.Delete data from a databaseThe deletion of the declaration is used to delete records from the database table.Grammar
DELETE from table_name WHERE
PHP's MySQL ORDER by command keyword
Command keywords are used to sort data records.The keyword for this commandCommand keywords are used to sort data records.The command keyword sort records are sorted in ascending order by default.If you want
Business requirements
Two servers are equipped with a database, in order to prevent a server problems and affect the operation of the business, need to prepare two servers to run MySQL, and need two server data is kept synchronized. That is to say
Usage instructions
1 ifnull (EXPR1,EXPR2)
If EXPR1 is not Null,ifnull () returns EXPR1, it returns EXPR2.
Ifnull () returns a numeric or string value, depending on the context in which it is used.
For example:
The code is as follows
Delete null data
The code is as follows
Copy Code
Delete from table name where field name = ' or delete from table name where field name =null
Remove Space data
Also contains spaces in the middle of the string,
MySQL Delete field duplicate data, after the search has just begun to do:
Delete from V_togowhere Tel in (select Tel. V_togo GROUP BY Tel has count (tel) > 1)and Togoid not in (select min (togoid) from V_togo GROUP BY Tel has count (tel) >1)
The MySQL database table's self-added primary key ID number is messed up and needs to be rearranged.
Principle: Remove the original ID and re-establish the new self ID.
1, delete the original primary key:
The code is as follows
#vi/etc/my.cnf
Open MY.CNF Modify Encoding
Vi/etc/my.cnf
Add under [mysqld]
The code is as follows
Copy Code
Default-character-set=utf8or DEFAULT-CHARACTER-SET=GBK.Add under [client]Default-character-set=utf8or
The solution is as follows:
The code is as follows
Copy Code
#vi/etc/my.cnf
Add the following coding settings in the appropriate place
The code is as follows
Copy Code
Left JOIN syntax
The code is as follows
Copy Code
Table_references:Table_reference [, Table_reference] ...Table_reference:Table_factor| Join_tableTable_factor:Tbl_name [[as] alias][{use| ignore| FORCE} INDEX (Key_list)]|
MySQL uses rand () for random queries
The code is as follows
Copy Code
1 ORDER by rand () limit X
Random MySQL query efficiency is extremely low, tonight I met a few wordpress plugin author, random value,
Batch search:
The SELECT statement is used to select data from the database.
Grammar
The code is as follows
Copy Code
SELECT column_name (s) from table_name
Instance
The code is as follows
First through the chkconfig command to see MySQL in the Not manageable list, the command is:
Chkconfig--list If this is not mysqld in the list, you need to add this command first:
Chkconfig Add mysqld
Then use this command to set the boot up:
This is a good way to solve these problems with MySQL's native tools.
Cases
Total records: 1016126, average size of 46822 per line
Let's say we're exporting and importing to a database named blog.
Export:
Mysqldump-u database user name-p
Indexing is the key to fast searching. The establishment of MySQL index is important for MySQL to run efficiently.
1. General Index
The only task for a normal index (indexed by the keyword Key or index) is to speed access to the data. Therefore,
Today new on a Linode VPS, choose Japan's Data Center! The speed is quite fast, the ping value is very low.
The direct clicks, registers the input da932e6d6e613d7e0ae2cd3bc1302581a927fb04, after using 3 months, Linode will return to me the $. Hey!
Mysql_fetch_lengths is used to determine the length of mysql_fetch_array (), mysql_fetch_assoc (), mysql_fetch_object (), or mysql_fetch_row (). If the display succeeds, false is returned;Mysql_fetch_lengths syntax.Mysql_fetch_lengths
Completely freeDomain format: yourchoice.599megs.comEnter the community function24/7 full FTP accessStorage space of 599 MB3rd Gbit/s bandwidthEasy-to-use control panelSupported forumsPHP and MySQL databases! Application address:
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