Hey guys,
I am making a forum using PHP with MySQL. I have gotten the basics of the forum to work. However I want to include a side pannel next to each post with information about the user (name (FK), age, avatar, sig, and so on.). The post data and the user data are stored in two seprate tables. The user data will be selected for each post depending on the user whom made the post. I use a while loop with a mysql_fetch_array to select and layout the data. At first I figured I would do a join to get both sets of data but then I relised that would just randomly return the user data with the post data. I could run a second select querry inside of the while loop so that it selected for each post that is in that topic but I don't know much about memory and banwidth management, so I am afraid that I may greatly slow down my site or cause a DOS on my own site. I have never used xml but after listining to other people talk about it I thought that maybe I could store the User data in XML and select the corect filed based on the name returned in the posts data.
So my question is would doing the multiple selects as I described do what I fear it will, Is there a diffrent method of doing this, and what method will work the best.
I can't back this up at all, but I don't think you'll see any significant gains by using XML, and you will force yourself to think in 2 paradigms instead of one. If you are seeing slow-downs because of the extra queries, I would look at your indexes before I bailed on the database.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks