+ 1
PDO prepare statement issue
I have some problems with PDO Connection?
8 Respostas
+ 1
Ok I will try and i hope it works
+ 1
PDO stands for PHP Data Objects
Is used to connect a PHP script with a data base
And can be connected as follows
$mbd = new PDO('mysql:host=localhost;dbname=test', $user, $password);
$stmt = $mdb->prepare('SELECT * FROM a_table');
$stmt->execute();
+ 1
When I execute stmt I get an error message, the message is no database selected.
and iam shure that my connection parameters is right.
+ 1
In the code, when you write
;dbname=
you must specify the correct name of your database
+ 1
I do that but i still have an error
+ 1
when i change my dbname and localhost the connection with db is still working, but when i change my pass it dose not work and this is unusually problem
+ 1
Try to use PhpMyAdmin. Probably it can give you a clue
0
If it's it's the connection via new PDO() connection try using new msql() connection, also oop