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> Quote Link to comment Share on other sites More sharing options...
Solution ArshSingh Posted April 6, 2014 Author Solution Share Posted April 6, 2014 (edited) resolved , there was missing ,,, $stmt->store_result(); Edited April 6, 2014 by ArshSingh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.