日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全I(xiàn)T社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > php開源 > php教程 > PHP 清空 MySql 指定數(shù)據(jù)表中的所有數(shù)據(jù)

PHP 清空 MySql 指定數(shù)據(jù)表中的所有數(shù)據(jù)

來源:程序員人生   發(fā)布時間:2014-04-08 11:51:35 閱讀次數(shù):3289次

PHP 清空 MySql 指定數(shù)據(jù)表中的所有數(shù)據(jù),在小編在網(wǎng)上閑逛時,這是某技術(shù)博客的一篇文章,說是文章,并沒有文字,只有代碼,經(jīng)過測試可以使用,現(xiàn)在分享給大家。

共有三個文件,其實也可以合并寫成一個。

1.conn.php:

Copy to ClipboardLiehuo.Net Codes引用的內(nèi)容:[www.veryhuo.com]
<?php
$id=mysql_connect("localhost","root","mysql") or die('連接失敗:' . mysql_error());
if(mysql_select_db("phpjcdb",$id)) //說明:phpjcdb 是數(shù)據(jù)庫名稱
echo "";
else
echo ('數(shù)據(jù)庫選擇失敗:' . mysql_error());
mysql_query("set names gb2312"); //設(shè)置為簡體中文
?>

2.index.php: 

Copy to ClipboardLiehuo.Net Codes引用的內(nèi)容:[www.veryhuo.com]
<?php
include("conn.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>清空指定數(shù)據(jù)表中的所有數(shù)據(jù)</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
.STYLE3 {font-size: 12px}
-->
</style>
</head>
<script language="javascript" type="text/javascript">
function deletes(){
if (window.confirm('確定要刪除該記錄??')==true){
return true;
}else{ return false;}
}
</script>
<body>
<form action="index.php" method="post" name="form1" id="form1">
<table width="614" height="90" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="53"> </td>
<td width="219"> </td>
<td width="355"> </td>
<td> </td>
</tr>
<tr>
<td height="26"> </td>
<td align="right"><select name="select">
<?php
$result = mysql_list_tables ("db_database06");
$i = 0;
while ($i < mysql_num_rows ($result)) {
$tb_names = mysql_tablename ($result, $i);
?>
<option value="<?php echo $tb_names;?>"><?php echo $tb_names;?></option>
<?php $i++; }?>
</select> </td>
<td><input type="submit" name="Submit2" value="提交" /></td>
<td width="20"> </td>
</tr>
<tr>
<td height="5"> </td>
<td align="right"> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="614" height="25" border="0" cellpadding="0" cellspacing="0" background="images/bg03.jpg">
<tr>
<td width="20"> </td>
<td width="569">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
if($_POST['Submit2']=="提交"){
$select = $_POST['select'];
$query1=mysql_query("select * from $select");
$query2=mysql_query("select * from $select");
$myrow=mysql_fetch_row($query2);?>
<tr>
<?php for($i=0;$i<count($myrow);$i++){?>
<td align="center">
<span class="STYLE2"> <?php echo mysql_field_name($query2,$i);?></span></td>
<?php } ?>
</tr>
<?php while($myrow=mysql_fetch_row($query1)){ ?>
<tr>
<?php for($i=0;$i<count($myrow);$i++){?>
<td align="center"><span class="STYLE3"> <?php echo $myrow[$i];?></span></td>
<?php } ?>
</tr>
<?php } } ?>
</table></td>
<td width="20"> </td>
</tr>
</table>
</form>
<form action="index_ok.php?lmbs=<?php echo $select;?>"
method="post" name="form2" id="form2" onSubmit="return deletes();">
<table width="614" height="28" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><input type="submit" name="Submit" value="刪除數(shù)據(jù)"></td>
</tr>
</table>
</form>
</body>
</html>

3.index_ok.php:

Copy to ClipboardLiehuo.Net Codes引用的內(nèi)容:[www.veryhuo.com]
<?php
session_start();
include("conn.php");
if($_POST['Submit']==true){
$lmbs = $_GET['lmbs'];
$result=mysql_query("delete from $lmbs");
if($result==true){echo "刪除成功!";}else{echo "刪除失敗!!";}
}
?>
生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機(jī)掃描二維碼進(jìn)行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 欧美日韩精品电影 | 国内黄色片 | 日韩精品欧美精品 | 六月婷婷久久 | 尤物yw| 精品国产免费久久久久久尖叫 | 欧美在线一区二区三区四区 | 亚洲国产精品视频一区 | 国产精品国产三级国产在线观看 | 欧美成人r级一区二区三区 欧美午夜精品一区 | 毛片网站在线观看 | 国产亚洲精品久久久优势 | av中文字幕第一页 | 黄色国产 | 在线高清av | 久久久久亚洲av成人毛片韩 | 久久6热视频 | 综合伊人 | 日韩激情精品一区二区三区 | 麻豆精品国产传媒mv男同 | 黄色免费网站入口 | 在线看av的网址 | 欧美性一级 | 精品国产一区二区三区久久久 | 久久国产精品99国产 | 性色av网站 | 成人欧美一区二区 | 亚洲欧美日韩在线不卡 | 欧美一区二区三区 | 亚洲毛片网站 | 国产精品久久 | 精品久久久久久亚洲精品 | 欧美激情视频一区二区三区在线播放 | 国产精品 - 去看片 亚洲免费黄色 | 欧美日韩一区在线 | 国产精品一区二区在线播放 | 亚洲国产精品成人av | 国产精品欧美激情 | 玖玖精品在线 | 粉嫩av亚洲一区二区图片 | 国产日韩一区 |