I\'m trying to insert data into a database that I have on my server.
To connect to my database I have the following code:
Here are some syntax rules to follow:
The SQL query must be quoted in PHP String values inside the SQL query must be quoted Numeric values must not be quoted The word NULL must not be quoted
If(isset($_POST['submit'])) {
$stmt = $db->prepare("INSERT INTO usersdata (Firstname, Lastname,
Email,Passward)
VALUES (:name, :lstname, :email,:pass)");
// inserting a record
then Bind the Values with your variables it will work