im trying to get some data from my db using this code:
<?php error_reporting(E_ALL); ini_set('display_errors',1); $mysqli2 = new mysqli(********************); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $sql2 = "SELECT message FROM wall_workouts_names WHERE id = ? "; $stmt2 = $mysqli2->prepare($sql2) or trigger_error($mysqli2->error."[$sql2]"); $id_for_wall = '43'; $stmt2->bind_param('s', $id_for_wall); $stmt2->execute(); $stmt2->bind_result($message); $stmt2->store_result(); $stmt2->fetch(); echo $message; ?>
My problem is that I get an empty string in my echo.
But if I run the same query in my phpmyadmin, I get good results.
thanks for the help
source share