genzedu777 Posted October 10, 2010 Share Posted October 10, 2010 Hi guys, I have coded this, however I have received an error msg, can someone advice me in this? Thank you Warning: mysqli_query() expects at least 2 parameters, 1 given in D:\inetpub\vhosts\abc.com\httpdocs\report.php on line 166 Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in D:\inetpub\vhosts\abc.com\httpdocs\report.php on line 167 <?php $sql = mysqli_query("SELECT * FROM tutor_preferred_district ORDER BY district_id ASC"); while($data = mysqli_fetch_array($sql)) { echo '<input name="district" type="checkbox" id="'.$data['district_id'].'" value="'.$data['district_id'].' class="required" title="Please check at least 1 location."> <label for="'.$data['district_id'].'">'.$data['district_name'].'</label>'; } ?> Link to comment https://forums.phpfreaks.com/topic/215552-warning-mysqli_query-expects-at-least-2-parameters-1-given/ Share on other sites More sharing options...
BlueSkyIS Posted October 10, 2010 Share Posted October 10, 2010 Warning: mysqli_query() expects at least 2 parameters, 1 given http://www.phpbuilder.com/manual/function.mysqli-query.php Procedural style: mixed mysqli_query ( mysqli link, string query [, int resultmode] ) Link to comment https://forums.phpfreaks.com/topic/215552-warning-mysqli_query-expects-at-least-2-parameters-1-given/#findComment-1120814 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.