Here is the error it gives me
Warning: mysqli::query(): Couldn't fetch mysqli in C:\xampp\htdocs\bootstrap\tickets_info.php on line 27
db problem.
Warning: main(): Couldn't fetch mysqli in C:\xampp\htdocs\bootstrap\tickets_info.php on line 31
Fatal error: Wrong SQL: SELECT `Uplata`, `Dobivka`, `Date`, `sharedTime`, `match1`, `match2`, `match3`, `match4`, `match5`, `match6`, `match7`, `match8`, `match9`, `match10`, `match11`, `match12`, `match13`, `match14`, `match15`, `match16`,`Odds`, `tip1`, `tip2`, `tip3`, `tip4`, `tip5`, `tip6`, `tip7`, `tip8`, `tip9`, `tip10`, `tip11`, `tip12`, `tip13`, `tip14`, `tip15`, `tip16`, `isActive`, `ticket_id`, `isShared`, `Username`, `Liked`, `is_wined` FROM `kladilnica` WHERE Username='s' Error: in C:\xampp\htdocs\bootstrap\tickets_info.php on line 31
And here is the code:
$user = getUserData('users', 'UserUsername');
$ticket = getUserData('kladilnica', 'ticket_id');
$sql = "
SELECT
`Uplata`, `Dobivka`, `Date`, `sharedTime`, `match1`, `match2`,
`match3`, `match4`, `match5`, `match6`, `match7`, `match8`, `match9`,
`match10`, `match11`, `match12`, `match13`, `match14`, `match15`,
`match16`,`Odds`, `tip1`, `tip2`, `tip3`, `tip4`, `tip5`, `tip6`,
`tip7`, `tip8`, `tip9`, `tip10`, `tip11`, `tip12`, `tip13`, `tip14`,
`tip15`, `tip16`, `isActive`, `ticket_id`, `isShared`, `Username`,
`Liked`, `is_wined`
FROM
`kladilnica`
WHERE
Username='{$user}'
";
$result = $conn->query($sql);
if(!$result) {
echo "db problem.";
trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn->error, E_USER_ERROR);
} else {
if($result->num_rows == 0){
echo "/";
} else if($result->num_rows >= 1) {
while($row = $result->fetch_assoc()) {
$is_wined = $row["is_wined"];
$uplata = $row["Uplata"];
$dobivka = $row["Dobivka"];
$uplata_total = $uplata_total + $uplata;
if($is_wined == 1){
$dobivka_total = $dobivka_total + $dobivka;
}
}
?>
I have executed successfully in phpMyAdmin