-1
I’ve made some changes to the program, but it’s still giving me the slip...:
mysqli_query() expects at least 2 Parameters, 1 Given.
<?php
$username="username";
$pwd="pwd";
include ("database.php");
session_start();
/*nesta linha----->*/ $res= mysqli_query("select username, pwd from user where username='$username' and pwd='$pwd'") or die(mysql_error());
if(mysql_num_rows($res)==0)
{
$res['username'] = $username;
$res['pwd'] = $pwd;
header('PaginaIniciaDoutora1.php');
}
else{
unset ($_SESSION['username']);
unset ($_SESSION['pwd']);
header('Pagina.php');
}
?>
dar erro
It is very generic, detail your problem better. See: http://answall.com/help/mcve– rubStackOverflow
In addition to detail better, show the
database.php
. If something is wrong in it will influence your code too.– ShutUpMagda
You must use
mysqli_query($con, "SELECT ...")
. Themysqli_query
requires the first parameter to be the connection and the second to be thequery
.– Inkeliz
I’m sorry confused but I still can’t work well with this site
– Kioko
@Inkeliz lol hadn’t seen your comment...
– MagicHat