Php Error Message..Pls help?

anand s

New member
This is the code

<?php

$db=mysqli_connect('localhost', 'root', '', 'test');

$sql = "insert into users ('name', 'add') VALUES ('anand' , 'Greeshmam')";

if(!(mysqli_query($db, $sql))) {
die('SQL ERROR: ' . mysqli_error ($db) . " - Query Was: {$sql}");
}

?>

The error message is
SQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''name', 'add') VALUES ('anand' , 'Greeshmam')' at line 1 - Query Was: insert into users ('name', 'add') VALUES ('anand' , 'Greeshmam')
 
Back
Top