nramenta / dabble

Lightweight wrapper and collection of helpers for MySQLi
MIT License
13 stars 4 forks source link

Select helper that works like delete #3

Closed anoxic closed 10 years ago

anoxic commented 10 years ago

For comparison, it is possible in dabble to use the (somewhat limited) delete method, with key-value pairs for the where clause:

 $db->delete('posts', array('published' => true));
 // instead of having to use
 $db->query('DELETE FROM `posts` WHERE `published` = :published', array('published' => true));

It would also be great to have a SELECT helper that works the same way

 $db->select('posts', array('published' => true))->fetch();
 // vs
 $db->query('SELECT FROM `posts` WHERE `published` = :published', array('published' => true))->fetch();

BTW, Dabble is awesome! :+1:

nramenta commented 10 years ago

Yes, it would definitely be great. I'll see what I can do.

Thank you for the kind words.

nramenta commented 10 years ago

Implemented in 0.5.5

anoxic commented 10 years ago

That's awesome! Thanks