Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Mysqli Connect (Database)

PHP Code

<?php 
$mysqli 
= new mysqli();
$mysqli->connect('Hostname', 'DBusernam', 'DBpassword', 'DBname ');

//Hostname - normaly localhost
//DBusername - your mysql username
//DBpassword - your mysql password
//DBname - your mysql database name


if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } 
thought we were supposed to use PDO
I mean the same thing but with better documentation can be found using Google.
(Jun 26, 2019 03:55 PM)SIM-3991524 Wrote:  thought we were supposed to use PDO

My opinion, many may disagree. Use whatever you feel comfortable with.

I use PDO, I use to use MySqli .

I find the whole debate on what to use confuses more than helps.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by SharoKurdiFeb 16, 2018 02:41 PM 10 408 Feb 16, 2018 02:41 PM
Last Post: blackcoder00
[PHP] by DarkWapOneJan 21, 2018 11:48 AM 2 145 Jan 21, 2018 11:48 AM
Last Post: RumbleFrog
[PHP] by DarkWapOneJan 21, 2018 11:46 AM 1 113 Jan 21, 2018 11:46 AM
Last Post: RumbleFrog