Proposal for "DB_DbQuery"

» Metadata » Status
  • Status: Proposed
» Description

DbQuery lets us to act directly over a query as if it were a table in our database. For example:


// connects to the database
$db = new DbQuery("library_test", "root", "xxx");

// executes an SQL query
$row = $db->query("
select as book_id,
    b.updated_on, as author_id, as author
from books as b
left join authors as a on = b.author_id
where = 11");

// updates the record
echo "Saving records ...\n";
$row->set("title", "Code Complete 2");
$row->set("author", "Steve McConnell");

// close the database connection

I'm not completely satisfied with this package and I would like to know your opinion. I think the DbQuery class has too much methods and this is indicative of a poor design. I'm working on it in any case.

» Dependencies » Links
» Timeline » Changelog
  • First Draft: 2013-11-01
  • Proposal: 2014-02-15