The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
problem driving me mad
PHP Code:
any help appreciated |
#2
|
||||
|
||||
You can join the user and userfield tables right in the first query:
Code:
$users = $DB_site->query(" SELECT userid,username,usertitle,field14 FROM user WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username "); echo "<table>"; if ($DB_site->num_rows($users)>0) { echo "<tr><td nowrap><p><b>Team Members Found:</b></p></td>".iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><p> </p></td>", "").iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><p> </p></td>", "")."</tr>\n"; while ($user=$DB_site->fetch_array($users)) { echo "<tr><td nowrap><p>$user[username] - $field[field14]</p></td>".iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><a href=\"user.php?action=viewuser&userid=$user[userid]\"><p>[view user]</a> <a href=\"user.php?action=edituser&userid=$user[userid]\">[Edit User]</a></p></td>", "")."</tr>\n"; } } echo "</table>"; Code:
iif($perms[ismoderator] or $bbuserinfo['usergroupid']==25, "<td nowrap><p> </p></td>", "") |
#3
|
||||
|
||||
it will need to pull field14 from userfield not users i think....so how exactly do I use join to stick both the coloms in the same query mate?
PHP Code:
|
#4
|
||||
|
||||
Of course I forgot the JOIN line... duh.
Code:
$users = $DB_site->query(" SELECT userid,username,usertitle,field14 FROM user LEFT JOIN userfield USING (userid) WHERE username LIKE '%".addslashes(htmlspecialchars($findname))."%' ORDER BY username "); |
#5
|
||||
|
||||
cheers for the help mate but its still not working dont happen to know were its going wrong do you mate?
PHP Code:
|
#6
|
||||
|
||||
Ok replace "SELECT userid" with "SELECT user.userid".
|
#7
|
||||
|
||||
thanks a lot mate worked a charm!!
really appreciated!! :bunny: |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|