ArshSingh Posted April 6, 2014 Share Posted April 6, 2014 hi there , so my problem is that im trying to select rows from database with mysqli->prepare for search autosuggestion, its not giving me a error but its not displaying ; poster , title , id that i have selected from database , i have other queries also and they work , but this ome is not working , here is the full code : a help would be great. <?php include("../secure/functions.php"); if($_POST) { $q=$_POST['searchword']; $stmt = $mysqli->prepare("SELECT `id`,`title`,`poster`,`story`,`director` FROM `movies` WHERE `title` like CONCAT('%', ?, '%')"); $stmt->bind_param('s', $q); $stmt->execute(); // Execute the prepared query. if($stmt->num_rows == 1) { $stmt->bind_result($id,$title,$poster,$story,$director); // get variables from result. $stmt->fetch(); } } ?> <a href="movie?title=<?php echo $title;?>"> <div class="display_box" align="left"> <img src="<?php echo $poster; ?>" /><?php echo $title; ?><br/> <span style="font-size:9px; color:#999999"><?php echo $director; ?></span></div></a> Link to comment https://forums.phpfreaks.com/topic/287564-mysqli-prepare-select-from-not-working/ Share on other sites More sharing options...
ArshSingh Posted April 6, 2014 Author Share Posted April 6, 2014 resolved , there was missing ,,, $stmt->store_result(); Link to comment https://forums.phpfreaks.com/topic/287564-mysqli-prepare-select-from-not-working/#findComment-1475144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.