You might want to have a read through this pdf
on the Snort site. Yes, I know it is aimed at RedHat and is about setting up Snort, but it goes through (in great detail) setting up MySQL, PHP and Apache to work together.
Just ignore the RH specific bits and it works great for Slackware. At least it did for me.