Mysqli connect

I wrote the code below for connecting with database but the following error msg coming,
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\wamp\www\petrolstation\files\db.php on line 10


<?php if(($password !='')&&($passdept!='')){ $sqlps=mysqli_query("SELECT * FROM user where user_ps_name='$passdept' AND user_ps='$password' "); while($rows=mysqli_fetch_array($sqlps)): $ps1=$rows['user_ps']; $user_dept=$rows['user_dept_id']; $user_id=$rows['user_id']; $user_name=$rows['user_name']; $station=$rows['station_id']; $st=$rows['st']; $_SESSION['usrid']=$user_id; $_SESSION['dep']=$user_dept; $_SESSION['pss']=$user_name; $_SESSION['station']=$station; $_SESSION['st']=$st; endwhile; }else{} ?>

please insert your code inside of [CODE][/CODE]

The first parameter in mysqli_queryneeds to be your DB connection

Sponsor our Newsletter | Privacy Policy | Terms of Service