Database class questions

3 views
Skip to first unread message

jsherk

unread,
Aug 23, 2010, 10:38:07 PM8/23/10
to PHPDevShell
In v 2.8.1 I can generate a query with
$query = $this->db->new_query('SELECT * FROM _db_tablename');

What I don't see are classes to help fetch/extract data from the
query. Am I missing it, or do I need to use an actual mysql_ function
to retrieve rows? Like this:
while ($row = mysql_fetch_object($query)) {
//Do something
}

Is it the same in v3? Or have you added any additional helper
functions to the db class?

I am wondering if you have (or are considering) moving to the PDO
abstraction layer, which would then allow phpds to use many other
databases instead of just mysql.

Thanks

TitanKing

unread,
Aug 24, 2010, 7:14:39 AM8/24/10
to PHPDevShell
Hi I stronly recommend you wait a few more days so we can roll
PHPDevShell V 3.0.0 out. The database functions are much more
advanced.

greg

unread,
Aug 24, 2010, 8:21:19 AM8/24/10
to PHPDevShell
That's correct. PHPDevShell has been originaly written with
performance in mind and with that objective direct use of MySQL call
was the most optimized way.
In v3.0 we chose to add a way to separate query from the main code.
This has many advantages: it gives the query more consistent by moving
some logic into it, making it a kind of "data source blackbox", it
makes the query re-usable, and it keep the code cleaner and easier to
read and maintain.

http://www.phpdevshell.org/docs/documentation-version-3-0/database-model-conversion/

jsherk

unread,
Aug 24, 2010, 8:40:29 AM8/24/10
to PHPDevShell
Ok.. that's what I wanted to know... if it will change in v3!

Thanks

jsherk

unread,
Aug 24, 2010, 6:07:42 PM8/24/10
to PHPDevShell
Will the new features include the ability to use prepared statements?

Thanks

greg

unread,
Aug 24, 2010, 7:12:30 PM8/24/10
to PHPDevShell
It's more than a prepared statement, it's intelligent sql. A query can
check its parameters, use default parameter values, check the result
values and format theses values at will.

jsherk

unread,
Aug 24, 2010, 7:20:47 PM8/24/10
to PHPDevShell
Sounds good!

greg

unread,
Aug 24, 2010, 7:22:37 PM8/24/10
to PHPDevShell
You can find an overview of the new query class at the url I gva you:
http://www.phpdevshell.org/docs/documentation-version-3-0/database-model-conversion/
Reply all
Reply to author
Forward
0 new messages