The code is as follows
Copy Code
Database processing ClassesClass db{The data save variables after SQL execution;var $db;Reads or sets the location of the current datavar $position = 0;Execute the SQL statement and save the result
We use the simplest method directly with Php+mysql to achieve, the method is as follows.
The code is as follows
Copy Code
Include (' db/db.php '); Include a library class$db = new db ();$result = mysql_query (' select *
One, install MySQL
If it is a Windows user, MySQL installation is very simple, download the installation files directly, double-click the installation file step-by-step operation can be.
Linux installation may be more simple, in addition to
Where optimizations are primarily in the Select, because they are used most largely, but the same optimizations can be used for delete and UPDATE statements.
However, please note that the following optimizations are not complete. MySQL has
MySQL Modified password Method summary
The first thing to declare is that in most cases, MySQL needs to have root privileges in MySQL, so the general user cannot change the password unless the administrator is requested.
Method One
Using
1, MySQL multiple table association Delete use alias, TBLWENHQ is the real table name, A is TBLWENHQ alias, B is another table name
The code is as follows
Copy Code
DELETE A from TBLWENHQ a,b where a.id=b.id
2.
If you set the unique attribute, which is also sensitive to the case of varchar, the resolver
The code is as follows
Copy Code
CREATE TABLE WORDS (ID BIGINT Auto_increment,WORD VARCHAR (128) not NULL UNIQUE,PRIMARY KEY
In order to be able to use replace, you must have both insert and delete permissions for the table.
The Replace statement returns a number that indicates the number of rows affected. This number is the same as the number of rows that were deleted
MyISAM: This is the default type, which is based on the traditional ISAM type, and ISAM is the abbreviation for indexed sequential access method (indexed sequential access methods), which is the standard way to store records and files. Compared to
You must be on the same machine as MySQL, you must be connected as a MySQL root user, and the root user must have Insert permissions and reload administrative privileges on the MySQL database. In addition, if you change the root password, you must
One, the most common MySQL most basic way to paging:
The code is as follows
Copy Code
SELECT * from content ORDER BY id desc limit 0, 10
In the case of small and medium data, such SQL is sufficient, the only
mysql command-common SQL statement Command code
Use G to display results vertically by rowIf a line is long and needs to be displayed, it's very hard to look at the results. By using g instead of a semicolon at the end of a SQL statement or command,
If you perform the "php-v" command to see the current PHP version information before you add it to the environment variable, you will be prompted for an error that does not exist, and here's how to add PHP and MySQL to the environment variables
1, download mysql-free version/binary plate software (do not compile)
File format: mysql-version-os.tar.gz
2, the creation MySQL group, establishes the MySQL user and joins in the MySQL group
(in different versions of UNIX, the syntax for
The mysql operation in php is very simple. However, when I was working on a small tool recently, I found that Chinese characters are garbled in the database written to mysql by php. This garbled problem has plagued me for a long time, clearly
Windows:We recommend that you do not install the software on the system disk. It can be the root directory or other directories, but it is best not to have spaces in the directory name to avoid some errors.Configure Apache and PHPOpen the Apache
MySQL is a fully networked cross-platform relational database system, a real multi-user, multi-thread SQL database server, and a distributed database management system with a client/server architecture. it has the advantages of powerful functions,
Although everything looks good, we still haven't achieved our goal of truly interacting with users. Our users should be able to enter arbitrary information and hand it over to PHP for processing. Next, let's take the example on the personalized
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