SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: expressions

  1. #1
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    expressions

    Can you put an expression in the where clause?
    If so how do you do it?

    i.e.
    I have a sequal statement similar to this...

    SELECT time FROM failedLoginAttempts WHERE.....;

    The statement needs to select only those times WHERE the time plus 15minutes is greater than the current time....



    thanks,

    Nick
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com

  2. #2
    Internet Business Optimizer KCgame's Avatar
    Join Date
    Mar 2005
    Location
    Singapore
    Posts
    931
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi y_oda2002,

    Yes, you can. For example (in PHP),
    PHP Code:
    // i assume you store date and time in your field
    $result=mysql_query("SELECT time FROM failedLoginAttempts WHERE time + 900  > NOW() " ) or die(mysql_error()); 
    Hope it helps

  3. #3
    SitePoint Addict y_oda2002's Avatar
    Join Date
    May 2005
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cooo...

    thankyou
    Nicholas Rhodes
    Asgard Development
    http://www.asgard-dev.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •