In progress of this issue:
Mysqli query return empty results
This is my php code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$mysqli2 = new mysqli('');
if (mysqli_connect_errno()) {
printf("Connect failed: %s
", mysqli_connect_error());
exit();
}
$sql2 = "SELECT message FROM wall_workouts_names WHERE id = '43' ";
$stmt2 = $mysqli2->prepare($sql2) or trigger_error($mysqli2->error."[$sql2]");
$stmt2->execute();
$stmt2->bind_result($message);
$stmt2->store_result();
$stmt2->fetch();
if($stmt2->num_rows > 0)
echo $message;
else
echo 'empty';
?>
From this code i get empty string as a result.
This is my table in phpmyadmin
When i run the same code but with this query:
$sql2 = "SELECT workout_name FROM wall_workouts_names WHERE id = '43' ";
My echo is "t", as is should be.
But when i run this query:
$sql2 = "SELECT message FROM wall_workouts_names WHERE id = '43' ";
I get empty string, something like this: "".
I dont understand what im doing wrong.