I am aware that this question has been asked many times but the solutions doesn\'t seem to be working for me.
I am writing a simple blog and I wanted to make an arch
In regards to your updated status, fetch_assoc() is not a member of a mysqli statement object. However, fetch() is and is the member function you are looking for.
You can also use bind_result() to access the data.
So an example would look something like:
$timestamp = time();
//create select statement
$stmt = $con->prepare("SELECT column_x, column_y, column_z FROM table_name WHERE date < ?");
//bind $timestamp to the prepared statement
$stmt->bind_param("i", $timestamp);
$stmt->execute();
//bind each selected column to a variable for iteration
$stmt->bind_result($column_x, $column_y, $column_z);
while($stmt->fetch())
{
echo $x . " " . $y . " " . $z . "\n";
}
Here is the reference link for the mysqli_stmt class
edit: I would also like to point out that while a mysli_stmt object does have a num_rows property, it is not the same as the num_rows property on a query result.