Pdo usage learning notes. 1. basic concepts 1. PDO: the abbreviation of PHPDataObject. The PDO extension class library defines a lightweight and consistent interface for PHP. It provides a data access abstraction layer, regardless of the basic
For the three APIs used by php to connect to the mysql database, refer to the self-php Manual. This article does not make much sense. it is just for your convenience to access the Internet.
1. MySQL extension of PHP2. mysqli extension of PHP3.
This article mainly introduces the ZendFramework database operation skills, and summarizes and analyzes the common functions, common operations, and precautions of ZendFramework for database operations based on the instance form, for more
Explanation of myslq_replace statement bitsCN.com
REPLACE runs like INSERT. There is only one exception. assume that an old record in the table and a record used for PRIMARY
If the new record of a KEY or UNIQUE index has the same value, the old
: This article mainly introduces common commands for PHP database operations. if you are interested in the PHP Tutorial, refer to them.
Connect to databaseDetermine whether the connection is successful or not. $ link = mysql_connect ('localhost', '
Create proc P_TEST @ Name VARCHAR (20 ),@ Rowcount INT OUTPUTASBEGINSELECT * FROM T_Customer where name = @ NameSET @ Rowcount = @ ROWCOUNTENDGOBytes ------------------------------------------------------------------------------------------ The
Scenario:There is a business database that uses MySQL 5.5 and writes a large amount of data every day. It is easy to delete data from multiple tables before the specified period from time to time, write a few WHILE loops. Although MySQL also has
Encapsulate your own DB Class (PHP) and db Class php. Encapsulate your own DB Class (PHP). encapsulate db Class php to encapsulate a DB class for special database operations. any operations on the database in the future will be implemented by DB
There are basically three types of commonly used objects: connection, command, and dataset.
A connection represents a physical connection to certain data storage areas (such as SQL Server or XML files.
Command indicates the command
Reply to database from log -- create Test Database
Create Database DB
Go
-- Back up the database
Backup database dB to disk = 'C: \ dB. Bak' with format
Go
-- Create a test table
Create Table dB. DBO.
UseTempdb Go --Create test table Create TableTB(IDChar(8)) --Create a unique index used to automatically filter duplicate values Create Unique IndexIx_tbOnTB(ID) WithIgnore_dup_key Go --Test data insertion Processing Time,Record Start Time
Add a salary to an employee. when half of the employees do not reach 6000 yuan, add 100 to all employees and print the salary.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> -- Add a
A problem encountered at work is the need for SQL
Recursive query So I went to csdn to ask, the efficiency was really high, and I didn't ask the question before. Problem description: I have a table structure as follows:
Id upperid
1 2
3 2
4 1
5. I
Normal mode, with $pdo->exec ($SQL); Can return the number of affected rows;
How do I know how to affect the number of rows if I insert delete data into a preprocessed object?$stmt = $pdo->prepare ($SQL);$stmt->execute ();
Reply content:
How to connect to the SAE database .. the last time I split the framework, I needed to connect to the SAE Database. I really didn't set up my own database. crazy sweat. sae gave this sae. class. php class, how can I use this swelling ?...............
Mysql ignores primary key conflicts and prevents repeated insertion of bitsCN.com
Several ways for mysql to ignore primary key conflicts and avoid repeated inserts
Solution 1: Use the ignore keyword
Solution 2: Use replace
Solution 3: ON DUPLICATE
This article describes in detail how to prevent repeated mysql insert records. if you are interested, you can refer to many methods to prevent repeated mysql insert records. ignore is commonly used, replace, on duplicate key update, of course we can
Inner join on, full outer join, left join on, right jion on1. Inner join on combination of internal join tables2. full outer is connected to the same combination of the two tables. Table A has data that table B does not have (it is displayed as null)
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.