PHP's MySQL WHERE clause
The WHERE clause is used to filter records.WHERE clauseThe WHERE clause is used to extract only those records that complete the specified criteria.Grammar
SELECT column_name (s) from
table_name
WHERE column_name
The first is the fastest, to fix the most common problems, and the last one is the slowest to fix problems that some other methods cannot fix. Review and repair MySQL data filesIf the above method cannot fix a damaged table, you can try these two
A query of numeric data:select*fromtb_namewheresum>100;Query predicate: >,=,,!=,!>,!=, Two query stringsSelect*fromtb_stuwheresname= ' Xiao Liu 'Select*fromtb_stuwheresnamelike ' Liu% 'Select*fromtb_stuwheresnamelike '% Programmer
For the locate function in MySQL, you can view the link: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_locate For the Replace function in MySQL, you can view the link:
Configure apache 1, create a new directory under D (for disks loaded with Apahe and PHP5) d:\web\www (of course, you can build a directory) to store PHP files (try to keep Apache and PHP5 under the same level of directory) . 2, locate the Conf
In fact, Apache and MySQL are installed as a function of the system services, as follows:
The code is as follows
Copy Code
D:wwwrootapachebin>httpd-k Install
Register successfully If you are prompted with the
MySQL Group BY tutorial, is grouping Oh.
When you have mastered the basics of MySQL, it takes time to take the next step and take on the aggregate function. Before we talk about them, let's review the definition, overall, as it relates to
The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for PHP access to the database. Each database driver that implements the PDO interface can expose specific database features as standard extension functions. Note that
OPTIMIZE TABLE is used to reclaim unused database space.
When rows of data on a table are deleted, the disk space occupied is not immediately reclaimed, the space is reclaimed after the Optimize table command is used, and the rows of data on the
There are three types of columns in MySQL: Numeric classes, string classes, and date/time classes.
There are only three types of columns from a large class to see the column type and the numeric type. However, each column type can also be
SELECT null =0, null =12345, null <>12345, null +12345, NULL | | ' abc ', NULL = NULL, NULL <> NULL, NULL and TRUE, NULL and FALSE, NULL or FALSE, NULL or TRUE, not (null);
If this is an interview question, I don't know how many programmers or even
First of all, mysql-bin.00000* similar files are MySQL log files.
by command
The code is as follows
Copy Code
Du-h–max-depth=1/
View the storage size of each folder under the root directory, found that/var
Method One, directly uses phpMyAdmin to modify the user select *.* or enter the IP address in "permission" management.
Method Two, use the MySQL grant command to operate
For example: Allow NewUser users to link to the MySQL server from the ip:192.1
The installation process is as follows:
First you can see that this is the mysql5.0 installation interface, select next to always install to the 2nd Step diagram display interface.
Step2
Next to here, is to choose the installation method. Look at
Specific operations
MySQL supports the join syntax for select and some update and delete cases, with specific grammatical details:Table_references:Table_reference [, Table_reference] ...Table_reference:Table_factor| Join_tableTable_factor:Tbl_name [
Delete a duplicate record method:
1. Create a new temporary table
The code is as follows
Copy Code
CREATE TABLE tmp as SELECT * from Youtable Group by name (name is not expected to have duplicate columns)
2.
The code is as follows
Copy Code
SELECT * FROM table_name ORDER BY RAND () LIMIT 5;
That's what Rand said in the handbook:RAND ()RAND (N)Returns a random floating-point value in the range 0 through 1.0. If an integer
Inquire
Today
The code is as follows
Copy Code
SELECT * FROM table name where To_days (Time field name) = To_days (now ());
Yesterday
The code is as follows
Copy Code
SELECT * FROM
The alternative is to use the timestamp type instead of the datetime type.Current_timestamp: When I update this record, this field in this record will not change.Current_timestamp on update current_timestamp: When I update this record, this field in
First, in Libmysql, the Mysql_opt_read_timeout settings item is provided, and the Libmysql provides an API for setting related settings items.
The code is as follows
Copy Code
Mysql_options: int stdcall Mysql_options
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