0

Trying to insert the Cookievalue into my database. Like this it's not Working (=no new data in the db)

$con = mysqli_connect("", "root", "", "db");
$firstname = mysqli_real_escape_string($con, $_COOKIE['firstname']);
$sql = "INSERT INTO table (firstname) VALUES ($firstname)";
mysqli_query($con, $sql);

but if I insert the VALUE like 'hello' it works fine.

0 Answers0