I am making a system and it presents me with an error when entering the login, which is
This is my connection code
<?php
$server="localhost";
$username1="root";
$password="";
$database="onexamdb";
$con=mysql_connect($server,$username1,$password);
if(!$con)
die( "Not connected") or mysql_error();
mysql_select_db($database);
?>
And this is the code I use to login
<?php
session_start();
include("connect.php");
if(!empty($_POST["login"])) {
$result = mysql_query("SELECT * FROM usertbl WHERE email='" . $_POST["email"] . "' and password = '".($_POST["password"])."'");
$row = mysql_fetch_array($result);
if(is_array($row)) {
$_SESSION["userid"] = $row['uid'];
$_SESSION["email"] = $row['email'];
$_SESSION["fname"] = $row['fname'];
$_SESSION["lname"] = $row['lname'];
$_SESSION["file"] = $row['file'];
header("Location:index.php");
}
}
?>
I don't know exactly why this error comes out, I'm new to php, if someone can help me please
As stated before, the version has changed and the correct function (that I know of) is "myslqi_". Try to use the following structure: