But I mean by $RightLoginTime = 'LoginTime';
the selected field from the database (LoginTime).. First I selected the
LoginTime from the database and now I'm trying to name a variable for it to
use it..

So what is the correct code?

Regards..
--------------------------------------------------
SASSINC Internet Solutions - Arabic Department
[EMAIL PROTECTED]
http://www.SASSINC.Net
----- Original Message -----
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Radwan Aladdin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 28, 2004 10:46 PM
Subject: Re: [PHP] Still error messages!!


> From: "Radwan Aladdin" <[EMAIL PROTECTED]>
>
> > I made that.. but there is something strange!!
>
> It's strange you can't follow instructions...
>
> > I SELECTED field from the database.. but it is not showing what it
> contains!!
> >
> > This is what is shown on the screen :
> >
> >  UPDATE accounts SET LogoutTime=1075313199SELECT
> LoginTime,Distance,LessonNumber FROM accounts WHERE UserName='' AND
> Password=''UPDATE accounts SET LessonNumber=LessonNumber + 1
> > Query error: You have an error in your SQL syntax near '0') WHERE
> UserName= AND Password=)' at line 1
>
> If you had printed out all the queries, you'd realize that error is coming
> from $query4.
>
> > > > > $query4 = "UPDATE accounts SET (Distance='" . $LogoutTime -
> > > > > $RightLoginTime . "') WHERE UserName=" . $UserName . " AND
> Password="
> > > > >. $Password . ")";
>
> $UserName and $Password have no value. Your "distance" calculation doesn't
> make any sense, either, as you're subtracting a string from an integer...
>
> > > > $LogoutTime = date("U");
> > > > $RightLoginTime = 'LoginTime';
>
> So you're setting distance equal to 1034566 - "LoginTime" (for example),
> which is just going to come out to $LogoutTime (since a string converted
to
> an integer is zero in this case).
>
> ---John Holmes...
>
> --
> 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