Postingan lainnya
mysqli_query() expects at least 2 parameters, 1 given
mau nannya gan
= 1) { echo "login berhasil"; }else { echo "login gagal"; } } } ?>
2 Jawaban:
<pre> <?php if (isset($_POST)) { $user = $_POST['user']; $pass = $_POST['pass']; $login = $_POST['login']; }
if (empty($user) and empty($pass)) { ?> <script type="text/javascript"> alert("username /password tidak boleh kosong"); </script> <?php } else {$koneksi = mysqli_connect($uname, $paswd, $db); ($sql = mysqli_query( $koneksi, "select * form tb_login where username = '$user' and password = md5('$pass')" )) or die(mysqli_error()); $data = mysqli_fetch_array($sql); $cek = mysqli_num_rows($sql); if ($cek >= 1) { echo "login berhasil"; } else { throw new Exception("login gagal"); }} ?> </pre>
masi eror gan Notice: Undefined variable: username in C:\xampp\htdocs\web\login.php on line 85
Warning: mysqli_connect() expects parameter 3 to be string, object given in C:\xampp\htdocs\web\login.php on line 85
Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\web\login.php on line 88
Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\xampp\htdocs\web\login.php on line 89