+ 2
how to connect to mysql?
I have got a mysql username and pasword. but its host is localhost how can i connect to it. its a vps hosting on cloudflare. any helps?
2 Respuestas
+ 2
for php take a look at mysqli_connect()
replace localhost by the name or ip of the server.
+ 3
try to use PDO
$bdd=new PDO("mysql:host=$host;dbname=$dbname", $user_db, $pass_db , array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));