本文整理匯總了PHP中module::load_sql方法的典型用法代碼示例。如果您正苦於以下問題:PHP module::load_sql方法的具體用法?PHP module::load_sql怎麽用?PHP module::load_sql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類module
的用法示例。
在下文中一共展示了module::load_sql方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init_sql
function init_sql()
{
if (func_num_args() > 0) {
$arg_list = func_get_args();
$module_id = $arg_list[0];
}
module::execsql("CREATE TABLE `m_lib_questions` (" . "`question_id` float NOT NULL auto_increment," . "`question_rank` float NOT NULL default '0'," . "`answer_type` varchar(5) NOT NULL default ''," . "`alert_flag` char(1) NOT NULL default ''," . "`question_cat` varchar(5) NOT NULL default ''," . "`question_text` text NOT NULL," . "PRIMARY KEY (`question_id`)" . ") TYPE=InnoDB; ");
module::execsql("CREATE TABLE `m_lib_questioncat` (" . "`cat_id` varchar(5) NOT NULL default ''," . "`cat_name` varchar(50) NOT NULL default ''," . "PRIMARY KEY (`cat_id`)" . ") TYPE=InnoDB; ");
module::execsql("CREATE TABLE `m_complaint_question` (" . "`complaint_id` varchar(10) NOT NULL default ''," . "`question_id` float NOT NULL default '0'," . "`question_frequency` float NOT NULL default '0'," . "PRIMARY KEY (`question_id`,`complaint_id`)" . ") TYPE=InnoDB; ");
module::execsql("CREATE TABLE `m_consult_complaint_question` (" . "`consult_id` float NOT NULL default '0'," . "`question_id` float NOT NULL default '0'," . "`complaint_id` varchar(10) NOT NULL default ''," . "`answer` varchar(10) NOT NULL default ''," . "PRIMARY KEY (`consult_id`,`question_id`,`complaint_id`)" . ") TYPE=InnoDB; ");
module::execsql("CREATE TABLE `m_complaint_question_diagnosis` (" . "`complaint_id` varchar(10) NOT NULL default ''," . "`question_id` float NOT NULL default '0'," . "`answer` varchar(10) NOT NULL default ''," . "`diagnosis_code` varchar(50) NOT NULL default ''," . "PRIMARY KEY (`complaint_id`,`question_id`,`answer`)" . ") TYPE=InnoDB; ");
module::load_sql("question.sql");
module::execsql("UPDATE `m_lib_questions` SET question_rank = question_id;");
}
示例2: init_sql
function init_sql() {
//
// create module tables
//
if (func_num_args()>0) {
$arg_list = func_get_args();
$module_id = $arg_list[0];
}
module::execsql("CREATE TABLE `m_patient_alert` (".
"`alert_id` bigint(20) NOT NULL auto_increment,".
"`alert_name` varchar(100) NOT NULL default '',".
"`alert_table` varchar(50) NOT NULL default '',".
"`alert_field` varchar(50) NOT NULL default '',".
"`alert_condition` varchar(100) NOT NULL default '',".
"`alert_message` varchar(100) NOT NULL default '',".
"PRIMARY KEY (`alert_id`)".
") TYPE=InnoDB; ");
module::load_sql("alerts.sql");
}
示例3: create_system_tables
function create_system_tables()
{
//
// create system tables if not present
//
if (func_num_args() > 0) {
$arg_list = func_get_args();
$dbname = $arg_list[0];
}
mysql_query("CREATE DATABASE `{$dbname}`;") or die(mysql_errno() . ": " . mysql_error());
mysql_select_db($dbname);
module::load_sql("setup.sql");
}