Databasic v2.0 has arrived!
Friday, March 13th 2009, 12:21am
Topics: Resources, Scripts
Tags: Databasic, Db, Class, Mysql, Script
Views: 719, Comments: 2
I am proud to present the new Databasic, version 2.0! Since I added quite a few new methods and functionality, rewrote and optimized most of the code, I felt it would be good to deem this version 2.0 instead of 1.11. The biggest new features in this version are support for multiple databases, using the create() method to create a database table, and the addition of many MySQL statement methods. Some of these new methods include drop(), truncate(), describe(), create() and optimize(). On top of all these additions, I have cleaned the code and fixed any bugs that were existent.
Note before upgrading! The new 2.0 version is not necessarily backwards compatible, the new system removes the constants that are used for the connection info, and instead uses a new method called store() that can store multiple connections. Finally the select() method has been changed, the arguments $limit and $offset have been removed and are now part of the $options array.
You may now subscribe to my newsletter, that will be send out emails when a script has a new version available.
Download Databasic v2.0
View the complete change log
Note before upgrading! The new 2.0 version is not necessarily backwards compatible, the new system removes the constants that are used for the connection info, and instead uses a new method called store() that can store multiple connections. Finally the select() method has been changed, the arguments $limit and $offset have been removed and are now part of the $options array.
You may now subscribe to my newsletter, that will be send out emails when a script has a new version available.
Download Databasic v2.0
View the complete change log
2 Comments
Mar 20th 2009, 00:02
So far it works great until i stuck with a query that have to match either conditions. However Databasic joins multiple conditions with AND. At the end i wet my hand to write a custom query, execute and fetch the result instead of just easily using Database::select() to achieve my goal. I hope this feature can be added in next release.
Anyway great job!
Mar 24th 2009, 03:33
See this UPDATE example:
$db = Database::getInstance();
// Build the variables
$columns = array(
'username' => 'milesj',
'age' => 0
);
$conditions = array('id' => 1);
// Execute the update
$query = $db->update('users', $columns, $conditions, 1);
// Statement now becomes:
// UPDATE `users` SET `username` = 'milesj', `age` = NULL WHERE `id` = 1 LIMIT 1
// but statement should became
// UPDATE `users` SET `username` = 'milesj', `age` = 0 WHERE `id` = 1 LIMIT 1
?>
Is this bug or logical behavior? How I can update a row where column value is int 0 (zero) ?