Page 1 of 1
Please Update ADODB
Posted: Tue Mar 08, 2005 10:37 am
by koehler
Could you please put at least v4.56 into /lib so that we (i) can use the AutoExecute feature.
This could ease the handling of db content a lot and makes it possible to beautify the code
because of less heavy SQL strings concatenations. Another pro is when refactoring code
it is possible to condense update/insert methods with big code footprint with this feature w/o
making the code unreadable (or understandable even after years)
Regards,
Michael
ADODB Feature Description
http://phplens.com/lens/adodb/docs-adod ... utoexecute
Re: Please Update ADODB
Posted: Thu Mar 10, 2005 12:11 pm
by piratos
The last version is 4.61 .
Re: Please Update ADODB
Posted: Thu Mar 10, 2005 8:36 pm
by Ted
I just put it on my TODO list
Re: Please Update ADODB
Posted: Mon Mar 14, 2005 11:45 am
by koehler
Thank you very much.
Btw. due to many SQL querys on each of my pages, i'm currently testing adodb sql cache. I added sql-cache hits stats to my cms. Maybe anyone
here would like it too. You have to update adodb first and if you are using news, then you MAY have to made changes there because of a method result
change at "$db->DBTimeStamp()". "MAY" because i do not updated the news module since 9.1 if you want to use sql cache, you have to use $db->CacheExecute(sql) for "selects"
Regards,
Michael
adodb.inc.php @version V4.61 24 Feb 2005
at line 1630
Code: Select all
global $adoCacheHits;
$adoCacheHits++;
index.php / cms v9.2
Code: Select all
$cachestr = '';
if (isset($adoCacheHits)) {
$cachestr = 'and ' . $adoCacheHits . ' cache queries';
}
echo "<!-- Generated in ".microtime_diff($starttime,$endtime)." seconds by CMS Made Simple $CMS_VERSION (".$cached."cached) using $sql_execs SQL queries $cachestr -->\n";
echo "<!-- CMS Made Simple - Released under the GPL - http://cmsmadesimple.org -->\n";
moduleinterface.php / cms v9.2
Code: Select all
if ($showtemplate)
{
$cachestr = '';
if (isset($adoCacheHits)) {
$cachestr = '(' . $adoCacheHits . ' SQL queries cached)';
}
echo "<!-- Generated in ".microtime_diff($starttime,$endtime)." seconds by CMS Made Simple $CMS_VERSION (not cached) $cachestr -->\n";
echo "<!-- Generated by CMS Made Simple - Released under the GPL - http://cmsmadesimple.org -->\n";
}
changes i made to my news module
Code: Select all
/*
$db->DBTimeStamp() seems to come back without the ' anymore with adodb v4.61
*/
if (isset($params["category"]))
{
$query = "SELECT news_id, news_title, news_data, news_date FROM ";
$query .= cms_db_prefix()."module_news WHERE news_cat = \"";
$query .= $params["category"]."\" AND ((".$db->IfNull('start_time',"'1/1/1900'");
$query .= " = '1/1/1900' AND ".$db->IfNull('end_time',"'1/1/1900'");
$query .= " = '1/1/1900') OR (start_time < ".$db->DBTimeStamp(time());
$query .= " AND end_time > ".$db->DBTimeStamp(time()).")) ";
}
else
{
$query = "SELECT news_id, news_cat, news_title, news_data, news_date ";
$query .= "FROM ".cms_db_prefix()."module_news WHERE ";
$query .= "((".$db->IfNull('start_time',"'1/1/1900'")." = '1/1/1900' AND ".$db->ifNull('end_time',"'1/1/1900'");
$query .= " = '1/1/1900') OR (start_time < ".$db->DBTimeStamp(time()) ;
$query .= " AND end_time > ".$db->DBTimeStamp(time()).")) ";
}
Re: Please Update ADODB
Posted: Mon Mar 14, 2005 2:08 pm
by Ted
Cool. Please let me know how it works out. If it's a positive thing, I'll gladly add it to CMS code. It's easy enough to do.