本文整理汇总了PHP中SqlHelper::dml方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlHelper::dml方法的具体用法?PHP SqlHelper::dml怎么用?PHP SqlHelper::dml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlHelper
的用法示例。
在下文中一共展示了SqlHelper::dml方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addstudent
public function addstudent($sno, $usernc, $truename, $pwd, $email, $tel, $major)
{
$SqlHelper = new SqlHelper();
$img = rand(1, 4) . ".png";
$sql = "insert into student values ('{$sno}','{$usernc}','{$truename}','{$pwd}','{$email}','{$tel}','{$major}','{$img}')";
$res = $SqlHelper->dml($sql);
$SqlHelper->close();
return $res;
}
示例2: insert_correct_question
public function insert_correct_question($correct_name, $correct_code, $true_code, $run_answer, $paper_id)
{
$sqlHelper = new SqlHelper();
$correct_code = str_replace("<", "\"", $correct_code);
$correct_code = str_replace(">", "\"", $correct_code);
$sql = "INSERT INTO `weike`.`correct` ( `correct_name`, `correct_code`, `true_code`, `run_answer`, `paper_id`) VALUES ( '{$correct_name}', '{$correct_code}', '{$true_code}', '{$run_answer}', '{$paper_id}')";
$res = $sqlHelper->dml($sql);
return $res;
}
示例3: register
public function register($user)
{
$sqlHelper = new SqlHelper();
$username = $user->getUsername();
$password = md5($user->getPassword());
$tel = $user->getTel();
$sql = "insert into user(username,password,tel) values ('{$username}','{$password}','{$tel}')";
$res = $sqlHelper->dml($sql);
$sqlHelper->close_connect();
return $res;
}
示例4: insert_question
public function insert_question($content, $username, $sno)
{
$sqlHelper = new SqlHelper();
$content = str_replace("<", "\"", $content);
$content = str_replace(">", "\"", $content);
$time = date('Y-m-d h:m:s');
$sql = "insert into bbs(content,username,date) values ('{$content}','{$username}','{$time}','{$sno}')";
$res = $sqlHelper->dml($sql);
$sqlHelper->close();
return $res;
}
示例5: deleteallArticle
public function deleteallArticle($arr)
{
$id = "";
$sqlHelper = new SqlHelper();
for ($i = 0; $i < count($arr); $i++) {
if ($i < count($arr) - 1) {
$id .= $arr[$i] . ",";
} else {
$id .= $arr[$i];
}
}
$sql = "delete from lavender_article where id in ({$id})";
$res = $sqlHelper->dml($sql);
$sqlHelper->close_connect();
return $res;
}