title: Warning: mysqli_query() [function.mysqli-query]: Empty query in C:\xampp\htdocs\option1\db_def.php on line 49
body: <p>Can anyone help me on this? I am a php beginner. Error I am getting is:</p>
  
  <blockquote>
    <p>Warning: "mysqli_query() [function.mysqli-query]: Empty query in C:\xampp\htdocs\option1\db_def.php on line 49"</p>
  </blockquote>
  
  <p>i.e where if statement starts.</p>
  
  <pre><code>&lt;?php
  include ('config.php');
  $con= mysqli_connect("localhost","root","") or die ("could not connect to mysql");
  
  if(isset($_POST['submit']))
  {
  $date= $_POST["date"];
  $sno= $_POST["sno"];
  // and so on
  
  $sql= mysql_query("INSERT INTO      data(date,sno,block,name,so_wo_do,plot_size,hno,hno1,street,mohalla,ws_id,sid,ws_conn,s_conn,dispo_conn,elec_acc,residential_commercial,trade_licence,hno2,street2,mohalla2,contact,email,year_construction,structure,nature_unit,usage,basement,gnd_floor,first_floor,sec_floor,third_floor,any_floor,total,area_sft,oid_no,remarks) VALUES('$_POST[date]','$_POST[sno]','$_POST[block]','$_POST[name]','$_POST[so_wo_do]','$_POST[plot_size]','$_POST[hno]','$_POST[hno1]','$_POST[street]','$_POST[mohalla]','$_POST[ws_id]','$_POST[sid]','$_POST[ws_conn]','$_POST[s_conn]','$_POST[dispo_conn]','$_POST[elec_acc]','$_POST[residential_commercial]','$_POST[trade_licence]','$_POST[hno2]','$_POST[street2]','$_POST[mohalla2]','$_POST[contact]','$_POST[email]','$_POST[year_construction]','$_POST[structure]','$_POST[nature_unit]','$_POST[usage]','$_POST[basement]','$_POST[gnd_floor]','$_POST[first_floor]','$_POST[sec_floor]','$_POST[third_floor]','$_POST[any_floor]','$_POST[total]','$_POST[area_sft]','$_POST[oid_no]','$_POST[remarks]')");
  
  if(!mysqli_query($con,$sql))
  {
      echo("Member Registered!");
  } 
  else
  {
      echo("Input data is fail");
  }
  }
  mysqli_close($con);
  
   ?&gt;
  </code></pre>