本文整理汇总了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");
}