views:

54

answers:

2

http://img293.imageshack.us/img293/857/tablez.jpg Here is a picture of the 2 tables.

The mybb_users table is the table that has the users that signed up for the forum.

The mybb_userfields is the table that contain custom profile field data that they are able to customize & change in their profile.

Now, all I want to do is display all users in rows with the custom profile field data that they provided in their profile(which is in the mybb_userfields table)

How can I display these fields correctly together?


For instance, p0gz is a male,lives in AZ,he owns a 360,does not know his bandwidth & Flip Side Phoenix is his team. How can it just be like "p0gz-male-az-360-dont know-flipside phoenix" in a row~???

+5  A: 

This looks for me like an ordinary LEFT JOIN

SELECT * FROM mybb_users
  LEFT JOIN mybb_userfields
    ON (mybb_users.uid = mybb_userfields.ufid)
WHERE username = 'p0gz'

This should display every row of the user p0gz

Nort
It came out withWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rootkbc1/public_html/mujak/test/test2.php on line 117
steven
uhm, try this code in phpMyAdmins SQL function. If you get a result, something must be wrong with your php code
Nort
I ran it in phpmyadmins sql function and it came out with Unknown column 'mybb_users.id' in 'on clause'
steven
Ooook :D the problem is that I have written `id` and it isn't `id` its `uid`. I'll edit my code, and after that, the query should work correctly. So the error was that I've tried to fetch a not existing column. Sorry
Nort
steven
then accept the answer please ;)
Nort
A: 

Thanks~!!! I accept Odens answer~!!!

steven