Now I fixed the error message.. but the problem is in "Distance = 0"
always.. because the LoginTime is a string.. I fetch it but the same thing!!

This is the new script :

<?php

phpinfo();
include("Config.php");

$link = mysql_connect("$user_hostname", "$user_username", "$user_password");
mysql_select_db("$user_database", $link);

$UserName = $_GET['UserName'];
$Password = $_GET['Password'];
$LogoutTime = date("U");

$query1 = "UPDATE accounts SET LogoutTime=$LogoutTime";
$query2 = "SELECT LoginTime,Distance,LessonNumber FROM accounts WHERE
UserName='$UserName' AND Password='$Password'";
$result2 = mysql_query($query2) or die("Query error: " . mysql_error());
$row2 = mysql_fetch_row($result2);
$query3 = "UPDATE accounts SET LessonNumber=LessonNumber + 1";

$RightLoginTime = 'LoginTime';
$Distance = 'Distance';
$LessonNumber = 'LessonNumber';
$LessonsTimeLimit = "30";


?> <pre> <?
echo $query1;
echo $query2;
echo $query3;
?> </pre> <?



$query4 = "UPDATE accounts SET Distance=" . $LogoutTime - $RightLoginTime .
" - LoginTime WHERE UserName=" . $UserName . " AND Password=" . $Password .
")";
$result4 = mysql_query($query4) or die("Query error: " . mysql_error());
$row4 = mysql_fetch_row($result4);
?> <pre> <?
echo $query4;
?> </pre> <?


if($Distance == $LessonsTimeLimit){
    $result3 = mysql_query($query3) or die("Query error: " . mysql_error());

}else{
    echo "Not yet!";
}

?>

So why it is making the Distance value = 0 and it doen't update the value in
the database. (Because it must update the value in the database by it)

Regards..
----- Original Message -----
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Radwan Aladdin" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 28, 2004 11:37 PM
Subject: Re: [PHP] Still error messages!!


> Radwan Aladdin wrote:
> <snip>
> > So where are the errors?
> >
> > Waiting your help please..
> >
> > Regards..
> >
>
> What's the error message???
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to