It looks like you're new here. If you want to get involved, click one of these buttons!
Stewartiee
newb
Hello. Currently i'm trying to get 10 random records out of my table. I figured doing the following would work, but it doesn't. Anyone give me some help?
$Games = $this->SQL->Select()
->From('Games')
->Limit($Limit)
->OrderBy('GameID', 'rand()');
Answers
Perfect! Thank you for that, I had a feeling it'd be something simple.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@jspautsch Thanks again, it's looking perfect for what I wanted to do. Do you happen to know if there is an autocomplete library built in? I know I have seen autocomplete somewhere in Vanilla before but I can't remember where.
FYI: The background games change every reload :D
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Autocomplete is used in Conversations, looking through that you can find the following javascript:
// Enable multicomplete on selected inputs $('.MultiComplete').livequery(function() { $(this).autocomplete( gdn.url('/dashboard/user/autocomplete/'), { minChars: 1, multiple: true, scrollHeight: 220, selectFirst: true } ).autogrow(); });So that's to autocomplete usernames, haven't tried it with anything else.
And then you need to have your theme or plugin include the jquery.autocomplete.js file on whatever page you want to use it on.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •