There are two methods to execute SQL statements in PDO:
1. exec() is used to process statements that do not return SQL results, such as insert update delete create, etc., but it will return the number of affected rows
If you are executing an insert statement, you can use the lastinsertid() method to get t ...
Added by flOid on Sat, 04 Apr 2020 11:29:40 +0300
When exporting, backing up and restoring Mysql database from the master database to the slave database, you need to pay attention to whether to enable GTID mode for the database. If you enable it, you should add the parameter -- set GTID purged = off to mysqldump data.
See reprint for details:
Here are the first 30 lines of a.sql exported with ...
Added by Jack_Slocum on Fri, 03 Apr 2020 08:48:03 +0300
In the absence of visualization tools to monitor database performance, common scripts come in handy. Here are a few scripts related to Oracle Performance for your reference. The following scripts have passed the Oracle 10g test, and Oracle 11g may need to be adjusted accordingly.
1. Find SQL statements with the most buffer \
Added by tarleton on Thu, 02 Apr 2020 18:31:04 +0300
public Cursor query(boolean distinct, String table, String columns,
String selection, String selectionArgs, String groupBy,
String having, String orderBy, String limit, CancellationSignal cancellationSignal)
//distinct: set to true, each row must have u ...
Added by ChrisDarl on Thu, 02 Apr 2020 09:37:46 +0300
Functions in MySQL
Functions in MySQL include character function, numeric operator and function, comparison operator and function, date time function, information function, aggregate function, encryption function, etc.
1. Character function
//For example, when you need to output last name and first name togethe ...
Added by Yaak on Thu, 02 Apr 2020 02:25:26 +0300
Tools: CMD sqlplus
Content: basic table operation, plsql programming (branch structure, loop, judgment, etc.)
preparation in advance
Tips for using cmd
Because the author uses sqlplus and enters in the cmd environment. It's not easy to edit the text in cmd environment, so I'll give you some tips.
Added by ianitm on Mon, 30 Mar 2020 19:37:27 +0300
To use pdo, you need to open the pdo extension first. I have opened the pdo extension of mysql here
ghostwu@dev:~$ php -m | grep pdo
1. Connect to the database
mysql> show create database shop \G;
*************************** 1. row ***************************
Create Database: CREA ...
Added by jvanv8 on Fri, 27 Mar 2020 17:03:39 +0200
If you want to record the user table modified and defined by DDL, set the default value, and so on, you can use event triggers to achieve this purpose.
Examples are as follows:
testdb=# create extension hstore;
testdb=# create or replace function ef_alter() returns event_trigger as $$
select hstore( ...
Added by m4rw3r on Tue, 24 Mar 2020 17:11:38 +0200
Data tables are usually associated with each other, and it is usually easier to use multi table associated query, which is more convenient and simple for more complex model associated query using laravel, Chinese document , take two tables of provinces and cities as an example
First, create a PlaceController controller ...
Added by zab329 on Mon, 23 Mar 2020 11:54:51 +0200
As we said earlier Factory Mode and Abstract Factory Mode , let's talk about the builder model.
The builder mode is also a very common creation mode. The two factory modes mentioned earlier hide the properties and construction details of a class, while the builder mode exposes the properties of a class appropriately through the Build ...
Added by g-force2k2 on Sun, 22 Mar 2020 09:04:09 +0200