The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
query question
I want to select a row from a table thats contains a list of ids which is simple enough but i want to then take each id from that row (1 per coloum) and use it to select roms in another table. I cant think of anyway to do this as there would be new colums added to the first table quite frequently.
|
#2
|
||||
|
||||
You can do queries within queries:
e.g. SELECT * FROM table WHERE(SELECT ids FROM table2); I believe ^^ |
#3
|
||||
|
||||
PHP Code:
|
#4
|
||||
|
||||
Quote:
I think that isn't available until MySQL 5 (or is it 4.1)? |
#5
|
||||
|
||||
^ crap i only run 4.0.18
|
#6
|
||||
|
||||
I'm pretty sure I read it in the mysql 4 manual
|
#7
|
||||
|
||||
Gotcha.
I had to dig it back up, because I didn't recall the specifics but it stuck out to me that 'I can't do this yet'. Apparently, it isn't a matter of can't, it is a matter of how (and that is what changes in 4.1) Quote:
http://dev.mysql.com/doc/mysql/en/Re...ubqueries.html Glad I saw this thread!! |
#8
|
||||
|
||||
So basicly im looking for something like this ??
[sql] $DB_site->query("SELECT id,name,icon FROM items LEFT JOIN items_users ON items.id=items_users.* WHERE items_users.userid IS $bbuserinfo[userid]; ORDER BY items.id ASC"); [/sql] |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|