You're all right.
ezSQL works with data as objects in backstage, and convert them into
arrays if needed. I've not followed ezSQL because my benches were clear:
data as arrays is faster than data as objects. TbsSQL works in backstage
only with data as arrays (extracting data, save in cache, ...) and
convert them into objects when you choose the option. Don't worry, this
is very fast. I bet it's even faster than ezSQL. That's also why TbsSQL
returns arrays by default.
---------------------
Skrol29
www.tinybutstrong.com
---------------------
Le 07/09/2010 16:17, TomH a �crit :
I just noticed by chance that the saved cache file was array of arrays.
No criticism of TbsSQL (or TBS) was intended, my apologies.
I am in the process of converting all of my ezSQL to TbsSQL - and trying to find
ways to make the migration as painless as possible - so let me ask a question
about it that will illustrate my complete ignorance of PHP OOP.
As an example, ezSQL uses the $Db->get_results while TbsSQL uses $db->GetRows
to get multiple row result set from the database.
The vast majority of my legacy code is like this:
$result=$Db->get_results($sql);
Is there a way for me to create a class extension that makes TbsSQL accept the
syntax $Db->get_results as if it were equivalent to $db->GetRows ???
Thanks for your endless patience with the unwashed!
Thanks for TBS every day,
TomH
Skrol29 wrote:
> Hi TomH, as equivalent to
> Is there a way for me to create a class extension that makes TbsSQL accept
> the syntax $Db->get_results as if it were equivalent to $db->GetRows ???
Something like this ?
class ezSQL_mysql extends clsTbsSQL {
function get_results($query, $output = 'OBJECT') {
if ($output==='OBJECT') {
return $this->GetRows(TBSSQL_OBJECT,$ query);
} else {
return $this->GetRows($ query);
}
}
}
Regards,
Skrol29
-----Message d'origine-----
De : tbs-...@googlegroups.com [mailto:tbs-...@googlegroups.com] De la part
de TomH
Envoyé : mardi 7 septembre 2010 23:42
À : tbs-...@googlegroups.com
Objet : Re: [tbs-next] $Db->GetRows(TBSSQL_OBJECT,$sql)
--
You received this message because you are subscribed to "TinyButStrong next
version".
Post to this group: send email to tbs-...@googlegroups.com
Subscribe: send email to tbs-next+...@googlegroups.com
Unsubscribe: send email to tbs-next+u...@googlegroups.com
More options: http://groups.google.com/group/tbs-next
Of courses, it would be a pleasure to meet you a take a time in Paris :)
Regards,
Skrol29
-----Message d'origine-----
De : tbs-...@googlegroups.com [mailto:tbs-...@googlegroups.com] De la part
de TomH
Envoyé : mercredi 8 septembre 2010 23:19
À : TinyButStrong Next Version
Objet : [tbs-next] Re: $Db->GetRows(TBSSQL_OBJECT,$sql)
Skrol29,
--