MyBB Community Forums

Full Version: php & mysql question...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm not sure this is the best place to post this question, but I don't know which forum would be better...

I'm trying to make a table (in mysql) which will contain certain information about each user in the mybb installation. I don't really think it needs to be "in mybb," since I can do with a simple page that does the sql queries itself, etc. But I cannot figure out how to "Select" the right information in sql if there is more than one entry in the table.

What I would essentially like to do, is as easily as possible, have a link in postbit (I know how to do that), which would link to a popup which would contain a bunch of information about that user. What I don't know how to do: (1) Make to link in postbit change what it links to based on what user it is. (2) I haven't figured out how to, on the php page, make it do a different sql query based on what it get passed from the link (ex. blahblahblah.php?uid=15 would do a query for user #15's information, and only show that.)

Unfortunatly, only a very small amount of my question has to do with mybb, and If that's all you guys want to help me with, that's fine, but I need some help with the php & sql as well.
if you are not going to base it on MyBB, then you need to create a connection to your database, then read the input from the request (uid), sanitize it, and then use it in a sql query.

if you are going to wrap the whole thing in a MyBB page, which i what i would recommend, then you can use the built-in database classes and get your info that way.

i would look at any existing code to see if you can figure out what you want to do. Simple check the postbit class file as it contains all the info you need to get a posters info and make a UID specific link as well as how to use variables within a query