I think ill try the first way you said. I am trying to pass email so it knows which login to change to no (this is the logout script). I managed to get the login script to change the login field in the database to yes.
Logout script not working - please give any hints why.
<?php
session_start();
require "connect.php";
$sql2 = mysql_query("UPDATE accounts SET login = 'no' WHERE email = '".$_SESSION['email']."'")
or die ("Couldn't perform query $sql <br />".mysql_error());
header("Location: index.php");
exit();
?>
This is the page with the logout button on (trying to pass the email of the logged on person from here):
Registered members:</br>
<?php
$sql = "SELECT email FROM accounts";
$result = mysql_query($sql)
or die ("Couldn't perform query $sql <br />".mysql_error());
$nrows = mysql_num_rows($result);
$email = mysql_fetch_row($result);
echo $nrows;
$_SESSION["email"] = $email;
?>
Thanks anyone