Zend - The PHP Company




Code Gallery: Syberius


Another MySQL Class  

Type: class
Added by: Syberius
Entered: 02/06/2003
Last modified: 31/10/2007
Rating: **** (3 votes)
Views: 6757
This MySQL Class allows an author to easily run SQL queries and catch/log errors in case of failure. While there are other classes that do this, I use my own because it was built for projects of mine that needed it, however it has been adapted for general use. The log functions are good for both debugging and keeping the error msgs away from visitors presenting them with a clean neat error message if there is a problem with MySQL or a query.


Custom session functions  

Type: class
Added by: Syberius
Entered: 09/01/2003
Last modified: 03/12/2002
Rating: **** (6 votes)
Views: 11764
I had allways wondered how sites using PHP could count online users and do lots of fancy stuff with sessions. I decided to experiment and I created a set of session functions to replace the default php session functions. I use session_set_save_handler() to tell php to use my functions for sessions. This worked well but I then decided to make the set of functions into a class for use on any project, quickly and easily. The class uses MySQL but with some modifications can be used with other databases. To use all you have to do is include the class file in your script and change the mysql connection variables.




Search