Re: Still error messages!!

From: Date: Wed, 28 Jan 2004 18:46:18 +0000
Subject: Re: Still error messages!!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-176094@lists.php.net to get a copy of this message
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...

« previous php.general (#176094) next »