The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
Hi,
Thanks for helping in advance. I'm running into trouble combining another 3 queries - 2 of them use the same variables. PHP Code:
I cannot use $test[title] since there are 2 title variables being called... how do I separate each title variable? Also, is joining these 3 queries valid? Thanks again for helping... |
|
#2
|
||||
|
||||
|
You give the fields aliases (a MySQL term), like so:
Code:
$test = $DB_site->query("
SELECT [high]forum.title AS forumtitle[/high],user.userid,[high]thread.title AS threadtitle[/high],threadid,thread.lastpost,lastposter,replycount,views,postuserid,postusername
FROM thread
LEFT JOIN forum USING (forumid)
LEFT JOIN user ON thread.lastposter=user.username
ORDER BY lastpost DESC LIMIT 5
");
|
|
#3
|
||||
|
||||
|
Firefly, thanks again for help.
You are very gracious. It works fine.
|
|
#4
|
||||
|
||||
|
You're welcome.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|