PROGRAMMING

MINTE9
REMEMBERS




Install Php

 
#install
sudo apt install php libapache2-mod-php
sudo systemctl restart apache2

#test
sudo touch index.php
sudo chmod 777 index.php
http://localhost/index.php
... 1 lines
˄˄˄
php.ini
 
sudo gedit /etc/php/7.2/apache2/php.ini
Php Mysql    (2/3)

Php MySQL

 
sudo gedit /etc/php/7.2/apache2/php.ini
extension=pdo_mysql 

sudo apt-get install php7.2-mysql
sudo service apache2 restart 
Example
 
$db = new PDO("mysql:host=localhost:3306;dbname=minte9", "admin", "password");
        
$sql = "SELECT * FROM domains";
$query = $db->query($sql);
$result = $query->fetch();
    
var_dump($result);
MySQLi
 
// PDO works with different database systems.
// MySQLi works only with MySQL.
Php Curl    (3/3)

Php Curl

 
sudo apt-get install php-curl

Questions    
5. MySQL
04 . Php
Last update:   11-09-2021

        A B C D E F
🔔
1/2