本文整理匯總了PHP中connection::insertData方法的典型用法代碼示例。如果您正苦於以下問題:PHP connection::insertData方法的具體用法?PHP connection::insertData怎麽用?PHP connection::insertData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connection
的用法示例。
在下文中一共展示了connection::insertData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: insertAction
public function insertAction($params)
{
$db = new connection();
$columns_values = array("sys_role_id" => 'NULL', "sys_role" => $params['sys_role'], "created_at" => $db->now_time, "flag" => 0);
$msg = "";
if ($db->alreadyExists("Select * from system_role where sys_role='" . $params['sys_role'] . "'")) {
$res = $db->insertData($this->table_name, $columns_values);
if ($res == true) {
$msg = "Success";
} else {
$msg = "Failed";
}
} else {
$msg = "Data Already Exists";
}
return $msg;
}
示例2: insertAction
public function insertAction($params)
{
$db = new connection();
$columns_values = array("sys_user_id" => 'NULL', "sys_name" => $params['sys_name'], "sys_role_id" => $params['sys_role_id'], "dob" => $db->storeDBDate($params['dob']), "email" => $params['email'], "mobile" => $params['mobile'], "address" => $params['address'], "user_name" => $params['user_name'], "password" => $db->encodeData($params['password']), "created_by" => $_SESSION['sys_user_id'], "created_at" => $db->now_time, "flag" => 0);
$msg = "";
// print_r($columns_values);exit;
if ($db->alreadyExists("Select * from system_user where user_name='" . $params['user_name'] . "' and email='" . $params['email'] . "'")) {
$res = $db->insertData($this->table_name, $columns_values);
if ($res == true) {
$msg = "Success";
} else {
$msg = "Failed";
}
} else {
$msg = "Data Already Exists";
}
return $msg;
}
示例3: insertAction
public function insertAction($params)
{
$db = new connection();
if (isset($params['menu_id'])) {
foreach ($params['menu_id'] as $pos => $val) {
$columns_values = array("sys_access_id" => 'NULL', "menu_id" => $val, "sys_role_id" => $params['sys_role_id'], "flag" => 0);
$msg = "";
if ($db->alreadyExists("Select * from system_access where flag=0 and sys_role_id='" . $params['sys_role_id'] . "' and menu_id='{$val}'")) {
$res = $db->insertData($this->table_name, $columns_values);
if ($res == true) {
$msg = "Success";
} else {
$msg = "Failed";
}
} else {
$msg = "Data Already Exists";
}
}
}
return $msg;
}