Som Fred -ii- säger, blanda inte mysql med mysqli
Det finns ingen direkt motsvarighet till mysql_result() i mysqli, men du kan använda funktionen mysqli_result implementerad i koden nedan. Denna funktion emulerar vad mysql_result() gör förutom mysqli-tillägget.
Ändra din kod till detta:
<?php
session_start();
?>
<html>
<link href="my_layout.css" type="text/css" />
<title>Phone Book Project</title>
<body class="my_body">
<div id="my_divition">
<?php
function mysqli_result($result , $offset , $field = 0){
$result->data_seek($offset);
$row = $result->fetch_array();
return $row[$field];
}
$connect=mysqli_connect("localhost","root","","phonebook");
$username=$_POST['username'];
$password=$_POST['password'];
$sql="select * from members where username='$username' AND password='$password'";
if($result=mysqli_query($connect,$sql)){
$number=mysqli_num_rows($result);
}
if($number>0)
{
$id=mysqli_result($result,0,"id");
$_SESSION['id']=$id;
session_register('id');
include('Control.php');
}
else
echo"<h1> <br /><br />Sorry : invalid entery <br /><br /></h1><a href=index.php >
go back </a>";
?>