Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@gmail.com,123,123)' at line 1 in C:\xampp\htdocs\practice\db_connection.php:43 Stack trace: #0 C:\xampp\htdocs\practice\db_connection.php(43): mysqli_query(Object(mysqli), 'INSERT INTO sig...') #1 {main} thrown in C:\xampp\htdocs\practice\db_connection.php on line 43


What I have tried:

$sql = "INSERT INTO signup (FirstName,Lastname,UserName, Email, Password, ConfirmPassword) VALUES ($Fname,$Lname,$Uname,$email,$password,$password2)";
Posted
Updated 18-Apr-22 11:16am

1 solution

In SQL queries strings and dates need quotes.

To avoid that (as well as other risks) it is recommended to use what is known as "parameterized queries". Let google explain further...

:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900