Remove sqlite3, the module installed by php7 compilation
Remove the modules installed by php7 compilation. Take sqlite3 as an example
SQLite3 extension has been enabled by default since PHP 5.3.0. Allow -- without SQLite3 disabled at compile time
background
When I develop a project, I need to use php to connect to the encrypted sqlite database, but the sqlite extension compiled by php by default do ...
Posted on Thu, 18 Jun 2020 05:05:33 -0400 by Pigmaster
RabbitMq encapsulating php
Simply encapsulate a rabbitmq class (business code is written casually)
First, account password configuration
config.php
<?php
return $arr = [
'RabbitMq' => [
// Rabbitmq service address
'host' => '127.0.0.1',
// Rabbitmq service port
'port' => '5672',
...
Posted on Tue, 02 Jun 2020 10:19:54 -0400 by mrtechguy
A single example of PHP PDO and mysql connection to prevent timeout
This database class mainly deals with creating database objects in single instance mode. If there are two long-time intervals to execute sql operations, the problem of connection failure will occur when processing again. A cache array is used to store pdo objects and timestamps, and the time between the two executions is compared. If the interv ...
Posted on Fri, 29 May 2020 04:02:35 -0400 by kaveman50
PHP PDO mysql abstraction layer
Using PDO constructor to connect database and DSN
<?php
$dbms = 'mysql';
$dbname = 'test';
$user = 'root';
$pwd = '123456';
$host = 'localhost';
$dsn = "$dbms:host=$host;dbName=$dbname";
try{
$pdo = new PDO($dsn,$user,$pwd);
echo 'pdo Successfully connected to database';
}catch(Exception $e){
echo $e->getMessage().'<br> ...
Posted on Mon, 25 May 2020 04:04:46 -0400 by duall
Linux install and enable PHP-FPM
First, take the -- enable FPM parameter with you at compile time:
[root@localhost local]# yum -y install libxml2 libxml2-devel gd gd-devel
[root@localhost local]# wget http://cn2.php.net/distributions/php-7.2.0.tar.gz
[root@localhost local]# tar -zxvf php-7.2.0.tar.gz
[root@localhost local]# cd php-7.2.0
[root@localhost php-7.2.0]# ./configu ...
Posted on Mon, 18 May 2020 10:06:10 -0400 by zako234
PDO operation on Mysql database
1. Briefly introduce what is PDO
PDO extension defines a lightweight and consistent interface for PHP to access database, which provides a data access abstraction layer, so that no matter what database is used, it can query and get data through consistent functions. PDO is released with PHP5.1 and can also be used in the PECL extension of PHP ...
Posted on Mon, 04 May 2020 01:10:06 -0400 by christophebmx
Three Ways of Connecting MySQL Database with PHP
This article introduces three ways of PHP connecting MySQL database (mysql, mysqli, pdo). It also analyses the related operation skills and precautions of PHP connecting MySQL database based on mysql, mysqli and PDO with examples.Has a certain reference value, friends in need can refer to, I hope to help everyone.
There are three API interfaces ...
Posted on Mon, 27 Apr 2020 13:24:45 -0400 by jabapyth
PHP realizes a simple student information management system (web version)
(∩_∩)
1. Overview
Learned some of the basics of PHP, including HTML, PHP, pdo, MySQL operations, etc., but they have not been organically combined. Recently, I wrote a simple web version of student information management system. Html is used in the foreground, JavaScript and PHP are used in the script, and MySQL is used in the database. ...
Posted on Wed, 22 Apr 2020 01:56:13 -0400 by blade_922
The magic method of PHP class
Construction method and destruct method
__construct is called when the class is instantiated.__destruct objects are called before they are manually destroyed or garbage collected.
unset(), object = null
Property overloads (Zu set, Zu get, Zu isset, Zu unset)
public __set ( string $name , mixed $value ) : void
public __get ( string $name ) : mi ...
Posted on Mon, 06 Apr 2020 02:03:32 -0400 by Amy1980
Accessing big data objects with PDO
Large object refers to the data with large capacity such as pictures stored in the database. Generally, pictures are rarely stored in the database.
First, create a table to access and store images:
create table images(id int not null auto_increment primary key,mimetype char(30),data blob);
There are four source fil ...
Posted on Sun, 05 Apr 2020 01:27:22 -0400 by troy_mccormick