开发者

How to join 2 tables & display them correctly? [closed]

开发者 https://www.devze.com 2023-01-03 19:47 出处:网络
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code nece
Closed. This question needs debugging details. It is not currently accepting answers.

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Closed 5 years ago.

Improve this question

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 u开发者_运维技巧sers 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~???


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

0

精彩评论

暂无评论...
验证码 换一张
取 消