This is a discussion on UPDATE'ing with multiple WHERES within the MySQL Database forums, part of the Database Forums category; So essentially I'm making a basic user online script with a timeout. However, it doesn't seem to be ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. Thanks! |
|
|||
|
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 |
|
|||
|
On 9 Nov, 03:55, Austin Pickett <phr...@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. > > Thanks! "it doesn't seem to be working" Wow, very informative! In what bl**dy way doesn't it seem to be working! Is there a syntax error? Is/are the wrong row/rows getting updated? Is nothing getting updated? How the h*ll do you expect anyone to be able to actually answer your question when you don't even say what the problem is!!!!! Think before you write! |
![]() |
| Thread Tools | |
| Display Modes | |
|
|