The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
Newbie question..
I'm rather embarrased to post this, but hey - we all have to start somewhere..
I've tried to integrate some options in to the admincp, but in the code where I want them to take effect, it causes a MySQL error.. I dare say there are certain rules to comply with in SQL queries - I'm still learning things.. Anyway, one of the created variables are $vboptions['journals_recentdisplaylimit'] In this example, I wanted to apply it to this piece of code: Code:
$journal_recent_entries = $DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.mood, e.np, e.timestamp, e.userid FROM journal_entry e, journal j, user u WHERE e.userid = u.userid AND e.userid = j.userid AND e.private = 0 AND j.enabled = 1 ORDER BY e.timestamp DESC LIMIT 30"); Code:
$journal_recent_entries = $DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.mood, e.np, e.timestamp, e.userid FROM journal_entry e, journal j, user u WHERE e.userid = u.userid AND e.userid = j.userid AND e.private = 0 AND j.enabled = 1 ORDER BY e.timestamp DESC LIMIT $vboptions['journals_recentdisplaylimit']"); Quote:
I figured I'd try and get around this by applying it to a second variable, so tried this: Code:
$recentdisplaylimit = $vboptions['journals_recentdisplaylimit']; Code:
$journal_recent_entries = $DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.mood, e.np, e.timestamp, e.userid FROM journal_entry e, journal j, user u WHERE e.userid = u.userid AND e.userid = j.userid AND e.private = 0 AND j.enabled = 1 ORDER BY e.timestamp DESC LIMIT $recentdisplaylimit"); Quote:
Oh - and if the SQL query is messy, don't blame me.. I didn't write it.! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|