$sql = "INSERT INTO kladilnica (Username, Uplata, Dobivka, Date, regTime, Odds, isActive, ticket_id, isShared, is_wined, Location) VALUES ('".$user."', '".$bet."', '".$gain."', '".$date."', '".$regTime."' '".$odds."', 1, $randomTicketID, 0, 0, '".$userLocation."')";
$result = $conn->query($sql);
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);

I searched on google and found that you need to have equal fields and values in the SQL. But sudently i have that but it gives me the same error again Column count doesn't match value count at row 1

NO WAY haha OMG :D btw now gives me another error which idk what is it
Fatal error: Wrong SQL: INSERT INTO kladilnica (Username, Uplata, Dobivka, Date, regTime, Odds, isActive, ticket_id, isShared, is_wined, Location) VALUES ('s', '100', '200', '2016-07-07', '03:07:32pm', '300', 1, 567899149, 0, 0, 'Russia') Error: in C:\xampp\htdocs\bootstrap\navigation.php on line 257 line 257 is the same SQL in this post

Date is a reserved word, use backticks for the column and table names.

Actyally i needed to remove the trigger_error and all works good :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.