NebuJohn Posted July 25, 2013 Share Posted July 25, 2013 This is my code $array=$_POST [numbers]; $result = mysqli_query($con,"SELECT * From profile WHERE code = $array"); while($row = mysqli_fetch_array($result)) { echo $row['id']; echo "<br>"; } mysqli_close($con); But I get an error given below: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given. Can anybody help me to get rid of this. Link to comment https://forums.phpfreaks.com/topic/280487-array-inside-select/ Share on other sites More sharing options...
PravinS Posted July 25, 2013 Share Posted July 25, 2013 you have passed invalid SQL query to mysqli_query() which return false to mysqli_fetch_array(), so you are getting this error. you cannot pass array in SQL query, you can convert array into comma(,) separated string and can use IN clause in SQL Link to comment https://forums.phpfreaks.com/topic/280487-array-inside-select/#findComment-1442054 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.