Ejemplo n.º 1
0
<html>
<meta charset="utf-8">
<body>

	<?php 
$i = 0;
$del = array();
while ($_POST['delContent' . $i]) {
    $del[] = $_POST['delContent' . $i];
    echo $_POST['delContent' . $i] . "<br>";
    $i++;
}
print_r($del);
$connect = mysql_connect(localhost, 'root', '1234') or ide("MySQL Server 연결에 실패했습니다.");
mysql_select_db("board", $connect);
for ($i = 0; $i < count($del); $i++) {
    mysql_query("DELETE FROM board_01 where headNt={$del[$i]}");
}
echo "<br>";
$i--;
$j = 0;
$minRange = $del[$i];
//12
$maxRange = $del[0] + 1;
//14
$delquery = mysql_query("SELECT headNt FROM board_01 WHERE headNt>={$minRange} ORDER BY headNt DESC");
while ($result = mysql_fetch_array($delquery)) {
    mysql_query("UPDATE board_01 SET headNt='{$minRange}' WHERE headNt='{$maxRange}'");
    $minRange++;
    $maxRange++;
}
Ejemplo n.º 2
0
<html>
<meta charset="utf-8">
<body>
	<?php 
$connect = mysql_connect(localhost, 'root', '1234') or ide("MYSQL연결에 실패하였습니다.");
mysql_select_db("board", $connect);
$mail = $_POST["mailName"] . "@" . $_POST["mailCompany"];
$tel;
settype($tel, "string");
$tel = $_POST["firstPN"] . $_POST["middlePN"] . $_POST["lastPN"];
if ($_POST['Name'] != NULL) {
    mysql_query("INSERT INTO member(Name, Id, Password, Mail, callNum) \n\t\t\t\t\t\t\tvalues('{$_POST['Name']}', '{$_POST['Id']}','{$_POST['Pass']}','{$mail}','{$tel}' )");
    echo "<script>alert('가입이 완료되었습니다.');window.open('main.php','_self');</script>";
}
?>
</body>
</html>