I have this code, a simple retrieve mysql data, but I receive this error upon submit.
Fatal error: Call to a member function bind_param() on boolean
I know that there is alot of solution, but I can't seems to find where is the problem coming from
Here is my code:-
$mysqli = new mysqli("localhost", "poke", "password", "pokedb");
if (isset($_POST['poke_name'])) {
$query = "SELECT name,lat,long,pic,description FROM creature WHERE name LIKE ?";
$param = "%{$_POST['poke_name']}%";
$stmt = $mysqli->prepare($query);
$stmt->bind_param("s", $param);
$stmt->execute();
$stmt->bind_result($name, $lat, $long, $pic, $description);
/* fetch values */
while ($pokeinfo = $stmt->fetch_assoc()) {
$poke_info[] = $pokeinfo;
}
/* close statement */
$mysqli->close();
}