Jump to content

Sql Syntax And Error


Cold Assassin
 Share

Recommended Posts

ok... I need help with an SQL Syntax and code I'm trying to run. Its for my vBulletin Forums. I'm trying to create a query that would display data on a php page...I dont need help with the php just the SQL syntax. The Syntax is as follows (I'll explain later) :)

SELECT `username`, `usertitle`, `aim`, `membergroupids`, `usergroupid`, `title`, `gamertag` FROM `vBuser` FULL JOIN `vBgxboxlive`,`vBusergroup` ON vBuser.userid = vBgxboxlive.userid, vBuser.membergroupids = vBusergroup.usergroupid WHERE `usertitle` Like '[sGx%' ORDER BY `membergroupids` DESC,`username`

Now let me explain my self...

SELECT `username`, `usertitle`, `aim`, `membergroupids`

Are from a table called "vBuser"

SELECT `usergroupid`, `title`

Are from a table called "vBusergroup"and

SELECT `gamertag`

is from a table called "vBgxboxlive"Now what im doing is creating a roster sorta thing so it will display all the members in a certain group (`usertitle` Like '[sGx%')I got a part that matches the field `userid` (from table vBuser) to field `userid` (from table vBgxboxlive). That works and also the `aim`, `username`, `usertitle` works! :)The only thing I need help along with is the matching of the `gamertag` `userid` (from vBxboxlive table) I also want it to match `membergroupids` (from vBuser table) to `usergroupid` (from vBusergroup table) and if they match display `title` (from vBusergroup table)I can get the display `title` in the php code...I believe its just an echo of ['title']Thanks to any1 that can help :)

Edited by Cold Assassin
Link to comment
Share on other sites

ok... I need help with an SQL Syntax and code I'm trying to run. Its for my vBulletin Forums. I'm trying to create a query that would display data on a php page...I dont need help with the php just the SQL syntax. The Syntax is as follows (I'll explain later) :)
SELECT `username`, `usertitle`, `aim`, `membergroupids`, `usergroupid`, `title`, `gamertag` FROM `vBuser` FULL JOIN `vBgxboxlive`,`vBusergroup` ON vBuser.userid = vBgxboxlive.userid, vBuser.membergroupids = vBusergroup.usergroupid WHERE `usertitle` Like '[sGx%' ORDER BY `membergroupids` DESC,`username`

Now let me explain my self...

SELECT `username`, `usertitle`, `aim`, `membergroupids`

Are from a table called "vBuser"

SELECT `usergroupid`, `title`

Are from a table called "vBusergroup"and

SELECT `gamertag`

is from a table called "vBgxboxlive"Now what im doing is creating a roster sorta thing so it will display all the members in a certain group (`usertitle` Like '[sGx%')I got a part that matches the field `userid` (from table vBuser) to field `userid` (from table vBgxboxlive). That works and also the `aim`, `username`, `usertitle` works! :)The only thing I need help along with is the matching of the `gamertag` `userid` (from vBxboxlive table) I also want it to match `membergroupids` (from vBuser table) to `usergroupid` (from vBusergroup table) and if they match display `title` (from vBusergroup table)I can get the display `title` in the php code...I believe its just an echo of ['title']Thanks to any1 that can help :)

I believe I answered my owh question, I have to create another query code and use "next" in the while statement to call it!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...