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

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.