——此文章摘自《完全手册PHP网络开发详解》定价
¥
特价
¥
详细>>http://track
linktech
cn/?m_id=dangdang&a_id=A
&l=
&l_type
=
width=
height=
border=
nosave>
$totalRows_rs_upt_type = mysql_num_rows($rs_validate_merge);
if(($totalRows_rs_upt_type>) && ($row_rs_validate_merge[type_name] ==
$_POST[type_name]))
{
//更新articles并且删除types
$updateSQL = sprintf(UPDATE articles SET type_id=%s last_upt_id=%s WHERE
type_id=%s
GetSQLValueString($_POST[new_type_id] int)
GetSQLValueString($_SESSION[MM_Username] text)
GetSQLValueString($_POST[type_id] int));
mysql_select_db($database_conn $conn);
$Result = mysql_query($updateSQL $conn) or die(mysql_error());
//删除
$deleteSQL = sprintf(DELETE FROM types WHERE type_id=%s
GetSQLValueString($_POST[type_id] int));
mysql_select_db($database_conn $conn);
$Result = mysql_query($deleteSQL $conn) or die(mysql_error());
echo <script>alert(类别更新成功!);</script>;
}
elseif($totalRows_rs_upt_type>) {
echo <script>alert(\类别更新失败!原因可能是\\n类别编号与现有的类别编号重复
\\n新类别名称与现有相同编号的类别名称不一致\);</script>;
}
else
{
//更新types
$updateSQL = sprintf(UPDATE types SET type_id=%s type_name=%s WHERE
type_id=%s
GetSQLValueString($_POST[new_type_id] int)
GetSQLValueString($_POST[type_name] text)
GetSQLValueString($_POST[type_id] int));
mysql_select_db($database_conn $conn);
$Result = mysql_query($updateSQL $conn) or die(mysql_error());
//同时更新articles表中的相应记录
$updateSQL = sprintf(UPDATE articles SET type_id=%s WHERE type_id=%s
GetSQLValueString($_POST[new_type_id] int)
GetSQLValueString($_POST[type_id] int));
mysql_select_db($database_conn $conn);
$Result = mysql_query($updateSQL $conn) or die(mysql_error());
echo <script>alert(类别更新成功!);</script>;
}
}
//删除操作
if (isset($_GET[MM_delete]))
{
$deleteSQL = sprintf(DELETE FROM types WHERE type_id=%s
GetSQLValueString($_GET[MM_delete] int));
mysql_select_db($database_conn $conn);
$Result = mysql_query($deleteSQL $conn) or die(mysql_error());
right>[http://developcsaicn/web/htm>] [] [http://developcsaicn/web/htm>] [http://developcsaicn/web/htm>] [http://developcsaicn/web/htm>]