Hi there I'll be glad if anyone has answer to this question, i recently change my pc os to Ubuntu and also download Xampp on it, but the problem now is PHP MYSQLI insert query not working on my pc, all the website i developed before, am unable to register on any of it on my pc localhost,
this site is on running on a lamp server... i initially noticed that there was a problem registering new account and adding new content to the website, I spent a long time trying to figure what could have happened to my code but i can't figure it out.
I using lampp for Ubuntu i downloaded from
https://www.apachefriends.org/download.html, and i use the command line below to install it
$ chmod 755 xampp-linux-x64-7.3.31-3-installer.run
$ ls -l xampp-linux-x64-7.3.31-3-installer.run
$ sudo ./xampp-linux-x64-7.3.31-3-installer.run
am runing the code below but am not getting any error message and the values are not inserted into the database, i also noticed if i creat a new database table, with just 2 columns id and fname, the values will be inserted but once the table columns is more than 2 it wont insert again also i cant register on my previous project database i imported to my lampp phpmyadmin
here is the code
<?php
// all db connections is declear here
$servername = "localhost";
$dBUsername = "root";
$dbPassword = "";
$dBName = "crypto";
$conn = mysqli_connect($servername, $dBUsername, $dbPassword,
$dBName);
if(!$conn){
echo "Database Connection Failed";
exit();
}
// insert into database
$RegS="INSERT INTO user_info (`fname`) VALUES('user')";
$RegR = mysqli_query($conn, $RegS);
if ($RegR == TRUE) {
echo'Successfull';
}
?>
I'll be glad if anyone can be of help.