I've currently developed some classes in PHP to really simplify all my database calls (very similar to Ruby on Rails). Using the new classes, I have developed a centralized content management system to use with some of our clients.
Additionally, I use the htaccess Rewrite functionality to build out the site hiererarchy. So the script grabs the URL, sends it to a switch statement (much like the Rails controller) to determine what to do. Then the switch performs the queries like such:
$page = new page;
//will set $page->id, $page->title, etc for all fields in the table
$page->set_for($id);
//grabs children of the page from the database for display of navigation
$children = $page->find_all(array('where' => "parent='$id'"));
And as far as I know, the scripts have been coded properly, but are taking 10-15 minutes to load. Which is unacceptable, obviously! The database will usually reside on a separate server. Would this be a huge setback? Are there any tips I need to know when developing code such as this? I haven't really spent a lot of time trying to optimize speed, and have read a lot of the forum threads and have implemented some of the tips (trying to minimize queries, etc). Any questions, please let me know! PHP 5.1.2 on DreamHost with the client's database residing on EasyCGI.
Sooo frustrated and I don't know where to begin debugging this! Any help is appreciated beyond words!