$result = mysqli_query($conn, "SELECT * FROM `cart`
LEFT JOIN `button` ON cart.id = button.id
UNION ALL
SELECT * FROM `cart`
RIGHT JOIN `button` ON cart.id = button.id
WHERE `user`='" . $user . "'");
while($row = mysqli_fetch_assoc($result))
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in C:\OpenServer\domains\test\cart.php on line 47