The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Hey
i use this SELECT email FROM user LEFT JOIN xxx USING (userid) WHERE $condition AND adminemail=1 it works fine, but i`m getting more then 1 match from table xxx, BUT i want just 1 match..... ![]() Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
i`m trying to make it in 2 querys.... but its interesting to make it in 1 query
|
|
#3
|
||||
|
||||
|
What is $condition?
|
|
#4
|
|||
|
|||
|
like 1=1 AND stuff=1
there will be more than 1 match |
|
#5
|
||||
|
||||
|
Code:
$result=$DB_site->query_first(" ... ");
OR use LIMIT: Code:
SELECT email FROM user LEFT JOIN xxx USING (userid) WHERE $condition AND adminemail=1 LIMIT 1 |
|
#6
|
|||
|
|||
|
you dont understand it
![]() SELECT email FROM user LEFT JOIN xxx USING (userid) WHERE $condition AND adminemail=1 this gives me many times the same email because there are more then 1 match in xxx table |
![]() |
|
|