Jump to content

Warning: mysqli_query() expects at least 2 parameters, 1 given


genzedu777

Recommended Posts

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>';

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.