Location: PHPKode > projects > Simple Way to Usenet > config/CNF/site_profile.cnf.php
<?php
$o['table'] = configs::get('db', 'table_prefix').'profile';
$o['struct'] = Array(	'ref' 		=> 'ref',
						'var'		=> 'var',
						'data'		=> 'data');

$o['mysql']	= Array(	'exists'	=> Array ('ispresent',	"SELECT COUNT(*) FROM `%table%` WHERE `%struct_ref%`='%arg_ref%' AND `%struct_var%`='%arg_var%'"), 
						'create'	=> Array ('insert',		"INSERT INTO `%table%` (`%struct_ref%`, `%struct_var%`, `%struct_data%` ) VALUES ('%arg_ref%', '%arg_var%', '%arg_data%')"),
						'update'	=> Array ('update',		"UPDATE `%table%` SET `%struct_data%`='%arg_data%' WHERE `%struct_ref%`='%arg_ref%' AND `%struct_var%`='%arg_var%'"),
						'read'		=> Array ('getonefield',"SELECT `%struct_data%` FROM `%table%` WHERE `%struct_ref%`='%arg_ref%' AND `%struct_var%`='%arg_var%'"),
						'delone'	=> Array ('delete',		"DELETE FROM `%table%` WHERE `%struct_ref%`='%arg_ref%' AND `%struct_var%`='%arg_var%'"),
						'delbyref'	=> Array ('delete',		"DELETE FROM `%table%` WHERE `%struct_ref%`='%arg_ref%'") 
				);
$o['sqlite']= Array(	'exists'	=> Array ('ispresent',	"SELECT COUNT(*) FROM '%table%' WHERE \"%struct_ref%\"='%arg_ref%' AND \"%struct_var%\"='%arg_var%'"), 
						'create'	=> Array ('insert',		"INSERT INTO '%table%' (\"%struct_ref%\", \"%struct_var%\", \"%struct_data%\" ) VALUES ('%arg_ref%', '%arg_var%', '%arg_data%')"),
						'update'	=> Array ('update',		"UPDATE '%table%' SET \"%struct_data%\"='%arg_data%' WHERE \"%struct_ref%\"='%arg_ref%' AND \"%struct_var%\"='%arg_var%'"),
						'read'		=> Array ('getonefield',"SELECT \"%struct_data%\" FROM '%table%' WHERE \"%struct_ref%\"='%arg_ref%' AND \"%struct_var%\"='%arg_var%'"),
						'delone'	=> Array ('delete',		"DELETE FROM '%table%' WHERE \"%struct_ref%\"='%arg_ref%' AND \"%struct_var%\"='%arg_var%'"),
						'delbyref'	=> Array ('delete',		"DELETE FROM '%table%' WHERE \"%struct_ref%\"='%arg_ref%'")
				);

$o['create']['mysql'] = "CREATE TABLE `%table%` (	`%struct_ref%`			varchar(32) NOT NULL,
  													`%struct_var%` 			varchar(255) NOT NULL,
  													`%struct_data%` 		text NOT NULL ) 
  											ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$o['create']['sqlite'] = "CREATE TABLE %table% (\"%struct_ref%\" TEXT, \"%struct_var%\" TEXT, \"%struct_data%\" BLOB)";
return $o;
Return current item: Simple Way to Usenet