Re: How to work with Sqlite and CMSMS 1.02
Posted: Tue Oct 10, 2006 6:19 pm
Ok but - the Module Search Writer must do something do let it run with sqlite. he can use adodb in the meantime to test.
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
else if($config['dbms'] == 'sqlite'){
$db = sqlite_open($config['db_hostname']);
sqlite_exec($db,'PRAGMA short_column_names = 1;');
if ($name != '')
$sql="SELECT css_text, css_name FROM ".$config['db_prefix']."css WHERE css_name = '" . sqlite_escape_string($name) . "'";
else
$sql="SELECT c.css_text, c.css_id, c.css_name FROM ".$config['db_prefix']."css c,".$config['db_prefix']."css_assoc ac WHERE ac.assoc_type='template' AND ac.assoc_to_id = $templateid AND ac.assoc_css_id = c.css_id AND c.media_type = '" . sqlite_escape_string($mediatype) . "' ORDER BY ac.create_date";
$result=sqlite_array_query($db,$sql,SQLITE_ASSOC);
foreach($result as $row)
{
$css .= "/* Start of CMSMS style sheet '{$row['css_name']}' */\n{$row['css_text']}\n/* End of '{$row['css_name']}' */\n\n";
}
}
Code: Select all
if ($config['dbms'] == 'mysqli' || $config['dbms'] == 'mysql')
{
...
}
Code: Select all
else
Code: Select all
if (!isset($DONT_LOAD_DB))
{
$db =& $gCms->GetDB();
}
Code: Select all
if (!isset($DONT_LOAD_DB))
{
$db =& $gCms->GetDB();
if($config['dbms'] == 'sqlite'){
sqlite_create_function($db->_connectionID,'now','time',0);
}
}
Added that to SVN too, eventhough modules shouldn't use the now() function, but should use $db->DBTimeStamp(); instead.brady wrote: Another small addition.