Executing SQL statements with PDO
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
Details of php pdo object usage: connecting database and exec method
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
pdo_mysql
ghostwu@dev:~$
1. Connect to the database
mysql> show create database shop \G;
*************************** 1. row ***************************
Database: shop
Create Database: CREA ...
Added by jvanv8 on Fri, 27 Mar 2020 17:03:39 +0200
New features of PHP7.0~PHP7.1~PHP7.2~PHP7.3~PHP7.4
As you all know, php is constantly updated and expanded, and each version has a performance improvement. Next, I will explain the new features of php 7. X. I will explain the features of each version.
New features of PHP7.0
New features of PHP7.1
New features of PHP7.2
New features of PHP7.3
New features of PHP7.4
N ...
Added by sherone on Thu, 27 Feb 2020 13:25:20 +0200
Query result field type in yii2 database
The default return from the yii2 database query is an AR object, where the field type is essentially the same as the database, but if asArray is used to return in an array, the default field type is all string, and if this json_encode is returned to the App end, it will be killed by the engineers of the strongly typed languages Android/IOS, and ...
Added by Eratimus on Mon, 30 Dec 2019 09:49:12 +0200
PHP for a simple data collection
Introduction
When it comes to data collection, python comes to mind first. The code is simple, efficient and easy to implement.
How does PHP implement data collection?It's simple.
concept
What is data collection?Below is the introduction of Baidu Encyclopedia:
Data collection, also known as Data Acquisition Is an interface that uses a device to ...
Added by agnalleo on Sun, 15 Dec 2019 08:00:42 +0200
PHP implements small program message board function (end) with comment function added
PHP Implements Message Board Function for Small Programs (End)
Next, the comment function is added to the above article. First, look at the effect map, as shown in the figure below.
I didn't delete comments here, because I didn't do it as I did in the article. Okay, next is the comment function code.l ...
Added by pereira2k5 on Tue, 01 Oct 2019 17:50:42 +0300
tp5-database connection
Connect to the database
ThinkPHP has built-in abstract database access layer, encapsulating different database operations. We only need to use common DB classes for operations, instead of writing different codes and underlying implementations for d ...
Added by DarkHavn on Sat, 24 Aug 2019 15:49:09 +0300
php design mode-registry tree mode
php registry tree mode
1. What is the registration tree mode?
Registered Tree mode registers object instances on the global object tree, removing objects from the global object tree when needed, just like buying candied gourds when you were a kid. Candied gourds are put on a big stick and people take them off when they buy them. The differenc ...
Added by phpr0ck5 on Sat, 13 Jul 2019 19:44:38 +0300
PHPer Initiative Learning Road: Recommendations for Practical PHP Open Source Libraries (1)
PHP is a universal open source scripting language. Grammar absorbs the characteristics of C language, Java and Perl. It is easy to learn and widely used. It is mainly applicable to the field of Web development and is the first choice of most back-end developers. As one of the most popular programming languages, PHP often appears in the battle o ...
Added by bschmitt78 on Mon, 08 Jul 2019 06:58:31 +0300