Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorjsanders
    • CommentTimeJul 27th 2005
     # 1
    i have a feeling this will probably need to wait until the documentation is more, um, filling...

    what is the proper(tm) method for executing an sql query within vanilla extensions?
    •  
      CommentAuthorMark
    • CommentTimeJul 27th 2005 edited
     # 2
    I don't have time to explain this one.
    You'll have to wait for the documentation.
    I will write another big part of it tonight.

    for the record, what are you trying to select?
    There are already a lot of different queries in the data objects that might work for you...
    •  
      CommentAuthorjsanders
    • CommentTimeJul 27th 2005
     # 3
    not to be too specific, but

    SELECT `UserID`,`Name` FROM `LUM_User` WHERE 1 AND `DateLastActive` >= (CURDATE() - INTERVAL 60 SECOND)


    and i figured this would be a documentation question. your code is so thick, it's amazing.
  1.  # 4
    whats the WHERE 1 for?
    •  
      CommentAuthorjsanders
    • CommentTimeJul 27th 2005
     # 5
    that wasn't supposed to actually be part of the query, it's just an artifact from phpmyadmin

    so...

    SELECT `UserID`,`Name` FROM `LUM_User` WHERE `DateLastActive` >= (CURDATE() - INTERVAL 60 SECOND)

    ... which will give a list of users active in the last 60 seconds. of course, this needs refinement and additional code, and of course, the obligitory phantom users options...

    i'd like to take this moment to prophesize. when the documentation explains enough for people to start writing meaningful extensions, this is going to explode. but i'm sure everyone that's here already can see that for themselves.
    •  
      CommentAuthorlech
    • CommentTimeJul 28th 2005
     # 6
    mini, he's writing a counter to see the number of currently active members :D
    •  
      CommentAuthorjsanders
    • CommentTimeJul 28th 2005
     # 7
    right on
  2.  # 8
    well i'd gathered that much lech, but the 1 in the where statement was irrelevant.
    •  
      CommentAuthorlech
    • CommentTimeJul 28th 2005
     # 9
    ahh, true.
Add your comments
    Username Password
  • Format comments as