I wrote my own webboard like 4 years ago. It does work to some extent but I must say my code were complete mess.
http://www.all-final.com/forum/list.php?forumid=
For the most part, I only studied from 1 PHP4 book and made the whole thing with a lot of scripts ripped from phpBB (which I only understand about 10% of it's code >< )
I have a spring break coming up so I decided to start my whole thing from scratch.
The first thing I'm really curious is that, as I read, repeatedly openning small connections to MySQL many times is not a good way. Making 1 big connection for all the information is the way to go. Is this true?
If I am trying to generate a forum viewing page for example. Currently I have a table ThreadID. And a seperate table for reply.
I use for each reply loop to pull out each member's and reply's information. So if there's 40 replies in a page it basicly makes 41 connection. 1 for the threadID and 40 more for each replies >< . ya, so ugly
Now I'm wondering how to optimize this part? I can't think of a way to request information for the whole thead in 1 shot. Any suggestions?
http://www.all-final.com/forum/list.php?forumid=
For the most part, I only studied from 1 PHP4 book and made the whole thing with a lot of scripts ripped from phpBB (which I only understand about 10% of it's code >< )
I have a spring break coming up so I decided to start my whole thing from scratch.
The first thing I'm really curious is that, as I read, repeatedly openning small connections to MySQL many times is not a good way. Making 1 big connection for all the information is the way to go. Is this true?
If I am trying to generate a forum viewing page for example. Currently I have a table ThreadID. And a seperate table for reply.
I use for each reply loop to pull out each member's and reply's information. So if there's 40 replies in a page it basicly makes 41 connection. 1 for the threadID and 40 more for each replies >< . ya, so ugly
Now I'm wondering how to optimize this part? I can't think of a way to request information for the whole thead in 1 shot. Any suggestions?
Comment