PDO connect
<?php
$db = new PDO('mysql:host=myhost;dbname=mydb', 'login', 'password');
PDO connect
<?php
$db = new PDO('mysql:host=myhost;dbname=mydb', 'login', 'password');
connect php to mysql pdo
<?php
$pdo = new PDO('mysql:host=localhost;
dbname=the_name_of_your_databe,
'username',
'password'');
# by default your username is root
# if you don't have a password don't fill in it
#(optional) :
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us