PHP OOP Login/Register tutorial - System: Database Querying

0 Drazen Ivancan · April 3, 2015
I copied the code and created a database identically as in the tutorial until the video No. 8, but my DB class doesn't want to execute the query. I don't know what the problem is. Does wrong settings of the virtual server on which I placed a test website may affect the non-execution of the query? Thanks in advance for your help.

Post a Reply

Replies

Oldest  Newest  Rating
0 Drazen Ivancan · April 4, 2015
when I execute query with hard code outside of class then I get my records successfully, but when I try to do within class DB.php all I get is an error:


Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected' in C:\xampp\htdocs\OOP-register-login\classes\DB.php:47

 Stack trace:
#0 C:\xampp\htdocs\OOP-register-login\classes\DB.php(47): PDOStatement->execute()
#1 C:\xampp\htdocs\OOP-register-login\index.php(5): DB->query('SELECT username...', Array)
#2 {main} thrown in C:\xampp\htdocs\OOP-register-login\classes\DB.php on line 47


I cannot continue this tutorial anymore, please help.
0 Drazen Ivancan · April 4, 2015
So, after two days I finaly came to conclusion that I have some kind of brain damage.

I HAVEN'T NOTICED THAT GRAMMATICAL ERROR!!!!!!

I wrote dbanme instead of dbname

 Sorry folks, I guess we can close this topic.
  • 1

PHP

107,066 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators