View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 10:29 AM
Rik Wasmus
 
Posts: n/a
Default Re: UPDATE'ing with multiple WHERES

On Fri, 09 Nov 2007 04:55:31 +0100, Austin Pickett <phragg@gmail.com>
wrote:

> So essentially I'm making a basic user online script with a timeout.
> However, it doesn't seem to be working and I feel that my problem lies
> within the UPDATE statement which updates a certain selection of
> multiple 'WHERE's
>
> The code:
>
> UPDATE list SET on='1' WHERE user='$user' AND user_logged<$timeout
>
> If anyone with some experience with this could take a look, much would
> be appreciated.


Query looks OK, no telling what $user & $timeout is substituted with
though. Display the raw query before you send it to MySQL, and check that
for errors. If you still don't get the desired result, provide some
testdata and a full query (i.e. $user & $timeout are substituted with the
actual values), and your desired result.
--
Rik Wasmus
Reply With Quote