I have a problem. My first code (MYSQL) is giving me the latest 5 rows from the table chat. My second code (MYSQLi) doesn't return anything, leaves the page blanc, and gives me no error messages.
Code 1:
$messages = array ();
$sql = mysql_query("select * from users ORDER BY pid DESC LIMIT 5");
while( $results = mysql_fetch_assoc($sql) )
{
array_unshift( $messages, $results);
}
Code 2:
$messages = array ();
$sql = mysqli_query($con, "select * from users ORDER BY pid DESC LIMIT 5");
while( $results = mysqli_fetch_assoc($sql) )
{
array_unshift( $messages, $results);
}
I think the code is fully correct. But still, as I said, I don't get any output, just a blanc page. Can anyone help me? I don't like PDO, so looking for procedural options.