connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "INSERT INTO meme (session, status) VALUES ('". $sesid ."', '0')"; if ($conn->query($sql) === TRUE) { // echo "New record created successfully"; } else { // echo "Error: " . $sql . "
" . $conn->error; } $conn->close(); */ } else { // echo "Cookie '" . $cookie_name . "' is set!
"; // echo "Value is: " . $_COOKIE[$cookie_name]; $sesid = $_COOKIE[$cookie_name]; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //"UPDATE MyGuests SET lastname='Doe' WHERE id=2"; // $sql = "UPDATE meme SET status='0' value='". $_GET["hasil"]. "' WHERE sesid='". $sesid ."'"; $sql = "INSERT INTO meme (session, status, value) VALUES ('". $sesid ."', '0', '". $_GET["hasil"] ."') ON DUPLICATE KEY UPDATE session='".$sesid."', status='0', value='".$_GET["hasil"]."' " ; if ($conn->query($sql) === TRUE) { // echo "New record created successfully"; } else { // echo "Error: " . $sql . "
" . $conn->error; } $conn->close(); } ?>

Please wait... dont refresh