misterfade
01-25-2006, 01:42 PM
I need help with some code. I have a special usergroup that only they can access a certain page. I want to set it up so that when they login, it displays their info from the USER table, and a custom table I created called TEST. Here's what I have so far:
<?php
if ($vbulletin->userinfo['usergroupid']==6)
{
$result = $vbulletin->db->query_read("SELECT * FROM test, user WHERE test.test_ID = user.userid");
while ($row = $vbulletin->db->fetch_array($result))
{
echo $row['test_name'];
}
}
?>
So basically I need to match their ID from the TEST table to the USER table, and display the relevant data. I know it's probably something simple, it's just that the Vbulletin query tags are screwing me up lol.
Thanks.
<?php
if ($vbulletin->userinfo['usergroupid']==6)
{
$result = $vbulletin->db->query_read("SELECT * FROM test, user WHERE test.test_ID = user.userid");
while ($row = $vbulletin->db->fetch_array($result))
{
echo $row['test_name'];
}
}
?>
So basically I need to match their ID from the TEST table to the USER table, and display the relevant data. I know it's probably something simple, it's just that the Vbulletin query tags are screwing me up lol.
Thanks.