• Save time with Queries

Nov
11

In developing the June Project and JuneLite I came up with something that was saving me a lot of time. This php class is calling the queries for me all I need to do is write the guts of the query, and if updating provide the record id. This class can connect to your database and then all you need to do is make calls to it below I show you how. In this version of the DB Class I have “Update, Insert and Delete”, I will be working on a method to pull selects out soon, but for now you will have to add your own select queries.
[php]
//==> how to call this
$db = new dbcon();
$db->update(‘table’, ‘row=your data’, ‘id’);
[/php]

The next section of code is how to insert into the database.
[php]
//==> how to call this
$db = new dbcon();
$db->insert(‘table_name’, ‘row=your info’);
[/php]

Download the Zip file here.

Leave A Comment!