I've tried many different ways of formatting this and none of them have worked.
Mysql history shows this is what it tries to execute: SELECT * FROM operations WHERE id= ? ORDER BY exectime
Heres the script:
<?php
$sql = "SELECT * FROM operations WHERE id = ? ORDER BY exectime";
if($stmt = mysqli_prepare($link, $sql)){
$stmt -> bind_param("i", $_SESSION["id"]);
if($result = $stmt->execute()){
if(mysqli_stmt_fetch($stmt) > 0) {
while($row = mysqli_stmt_fetch($stmt)) {
echo $row[0];
}
} else {
echo "Empty";
}
} else{
echo "Oops! Something went wrong. Please try again later.";
}
mysqli_stmt_close($stmt);
}
?>
The even weirder thing is I'm using bind_param on the login pages and works completely fine.
It doesn't even echo "Oops! Something went wrong. Please try again later.";