Re: Still error messages!!

From: Date: Wed, 28 Jan 2004 18:54:40 +0000
Subject: Re: Still error messages!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-176097@lists.php.net to get a copy of this message
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 raladin@emirates.net.ae http://www.SASSINC.Net ----- Original Message ----- From: "John W. Holmes" <holmes072000@charter.net> To: "Radwan Aladdin" <raladin@emirates.net.ae>; <php-general@lists.php.net> Sent: Wednesday, January 28, 2004 10:46 PM Subject: Re: [PHP] Still error messages!! > From: "Radwan Aladdin" <raladin@emirates.net.ae> > > > 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 >

« previous php.general (#176097) next »