Tanjir's IBlog » Page 'A Very Simple Database Library for PHP and MySQL'

A Very Simple Database Library for PHP and MySQL

There are plenty of complicated and complete libraries available for MySQL and PHP- which are used widely in big projects. For small projects we either use our own small library or we don’t use anything at all. The bad thing about not using anything at all are: a) The database information gets spread all over the places and b)we often forget to check security and c) a lot of code duplication.
To address these issues I have written a very simple database library (or I better call it a driver) in PHP for MySQL. I have added a sample file on how to use the library with the file. You can download it from here[format: zip | tar.gz].

In this file following functions are available:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Constructor:

$myDbCon = new dbCon();

//Methods:

query($q);

getObject($table, $property, $value);

getObjects($table, $property, $value);

query_get_object($q);

error();

insertId();

I hope it will be helpful.

Leave a comment

XHTML - You can use:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2008 Tanjir's IBlog is powered by WordPress