When you use a content management system like Joomla and WordPress you can use components, modules, extensions, php frameworks and pure php/mysql.
Adding Pure PHP / MYSQL
The content management systems have many available templates and extensions, but, there may be times when you have a stand-alone php/mysql application that you want to add, but not recode into an extension. You just want to add it quick.
To add a pure php / mysql application you simply copy and paste the application inside the root directory. The index.php file could be accessed like mysite.com/socialbookmarks/index.php. The url could be added to the main menu of the content management system. The urls for each file of the new application could use absolute or relative urls; like join.php or http://mysite.com/bookmarks/join.php.
To finalize the application, you can dump the database schema into the existing database for the CMS, or use a different database. The application can use the same stylesheet too if an absolute url is used to link the stylesheet.
To keep it simple and use a php / mysql cms you can try Sitemakin CMS.