I can't connect to MySQL.

Hello.
I’m using right credentials and mySQL even doesn’t return any error, sending data by forms (method POST) definitely does not work. Files I’m using: http://miroslawzelent.pl/pliki/kurs_php3.zip (in zip “koniec pracy - stan po odc 3/osadnicy”). I also used “PDO”, but it failed.
By the way, moving these files to /home directory returns an error 1045, which means “access denied”. But my credentials are definitely right…
In connect.php there should be login, Cpanel password, database name and host. And that’s all, it should work. (If it shows any red information when you click “Zaloguj” it means that it works.)

EDIT: INSERT INTO works. But “SELECT” returns an error…

@xRitsu said:
Hello.
I’m using right credentials and mySQL even doesn’t return any error, sending data by forms (method POST) definitely does not work. Files I’m using: http://miroslawzelent.pl/pliki/kurs_php3.zip (in zip “koniec pracy - stan po odc 3/osadnicy”). I also used “PDO”, but it failed.
By the way, moving these files to /home directory returns an error 1045, which means “access denied”. But my credentials are definitely right…
In connect.php there should be login, Cpanel password, database name and host. And that’s all, it should work. (If it shows any red information when you click “Zaloguj” it means that it works.)

Please try reading this KB article:
https://infinityfree.net/support/how-to-connect-with-mysql/

And also this:
https://infinityfree.net/support/common-mysql-errors/

I’ve already read this… I said. I pick the right credentials

@xRitsu said:
EDIT: INSERT INTO works. But “SELECT” returns an error…

So… what does the error say? Figuring out what an error message means is a lot easier if you, you know, know the error message.

@Admin said:

@xRitsu said:
EDIT: INSERT INTO works. But “SELECT” returns an error…

So… what does the error say? Figuring out what an error message means is a lot easier if you, you know, know the error message.

Actually, THIS error occurred because I picked not right connect.php file.

But it still can’t read $_POST data from text fields on index.php. Registration - what is strange - works flawlessly. When you register, I have a new record in my database:

But… when you try to log in, it fails and doesn’t get $_POST vars. (they’re empty, when I try to ‘echo’ them).
Also, the script returns an error which isn’t php error, just like the username was wrong so ‘else’ statement becomes true on “if ($ilu_userow>0)” (says how much users with username like in login inputbox exist in database). But because there are no $_POST vars, it can’t execute successfully.

http://xritsu.22web.org/osadnicy/

Okay, I found what was the reason… It was .htaaccess file. Thanks for your help