Oscar up the Gog

                    www. Jawapro .com
                    A Seriously Froody Website


 
 

 
 

 
 

 
 

 
 


Image
Drongo PHP Database Connection System

Author: jawapro
Date: Fri 13/04/2007 10:00 AM




Well - guess what?

I´ve actually developed some dodgey code that other people might find usefull.

I´ve named it the "Drongo PHP Database Connection System".

If you´re interested in PHP programming and especially using MySQL and Postgres databases - then this might interest you. Otherwise - you´d probably want to skip this post.

Basically - the Drongo system means you can write code that will work on both MySQL and Postgres systems - by only changing a line or two (in the dbwrapper.php file).

Instead of calling either database directly, you have to call the functions in my code. It includes:

dbconnect()

dbwrite()

dbread()

dbdisconnect()

And when the data comes back - it´s in the Postgres format. As in $arrayname[$i][´fieldname´]

So for each row that matches, you get one entry in the first array, and that entry is an array of all the fields.

Sound complicated? Well - I used to use the MySQL way of doing things for ages - but now I´ve used Postgres, I dont want to go back. Why? - not sure, but I like it.

But sometimes you have to use MySQL because Postgres isnt avaliable - and this will let you emulate it. Sort of. Dosnt do anything about dates and what-not. It´s only the way you send SQL to-and-fro.

At the moment it has no documentation or anything - so it might be difficult to understand - but I wanted to put it up here so I can find it when I need it :)
I´ll add some proper documentation soon.

So if you´re interested - take a look.

drongo.zip (21k)

JP


Comments: 1
 

Image

Comment: 1

Author: Nifen
Date: Mon 16/04/2007 08:16 AM




oooooo wow, oooo ohhh snoreee...