Today i am back with another MySQL problem on my Raspberry.
I have a code which inserts me a user input in the table 'users' on the database 'users' which looks like this:
BTW i know logging in with root is not the safest way but i tried to be sure that i dint messed up my MySQL user.
$mysqli = new mysqli("localhost", "root", "passwd", "users");
$mysqli->query("INSERT INTO `users` (username, email, firstname, lastname, password) VALUES ('$username', '$email', '$fname', '$lname', '$passwdhash')");
$mysqli->commit();
This worked fine until i nuked my Raspberry because i had a problem with my ssh server.
i installed everything new (php, mysql, phpmyadmin, apache2) and now my script isnt working.
I checked the status of my apache and mysql service and both are working fine. (acc. to my Raspberry)
For error catching i tried this:
$success = $mysqli->query('localhost', 'root', 'passwd', 'users');
if (!$success) {
print_r($mysqli->error);
}
I dint know if the problem is my Raspberry or my script so i am asking here to be sure that its not my script that is causing the error.
Thank you for your help.