Why am getting error when i think it should work fine
Error
Fatal error: Wrong SQL: INSERT INTO kladilnica (Username, Bet, Win, reg_date, Odds, isActive, ticket_id, isShared, is_winned, Location) VALUES ('Stefan', 100, 3500, '2017-02-06', 66, 1, 351358728, 0, 0, '') Error: in C:\xampp\htdocs\bootstrap\navigation.php on line 257
Code
$sql = "INSERT INTO kladilnica (Username, Bet, Win, reg_date, Odds, isActive, ticket_id, isShared, is_winned, Location) VALUES ('".$user."', ".$bet.", ".$gain.", '".$date."', ".$odds.", 1, $randomTicketID, 0, 0, '".$userLocation."')";
$result = $conn->query($sql);
$TicketID = $conn->insert_id;
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);