无为清净楼资源网 Design By www.qnjia.com
下面这个程序在你输入id后就把那个id的数据列出来。然后你就可以修改后写入了.
<html>
<body>
<h1>数据库的数据更新</h1>
<?
if(isset($id))
{
if(!mysql_connect("localhost","用户名","密码"))
{echo"无法联接数据库";
exit();
}
if(isset($url))
{
$query="update $jpg set id='$id',url='$url',mess='$mess',
fromx='$fromx',url1='$url1',mess1='$mess1',fromx1='$fromx1',url2='$url2',
mess2='$mess2',fromx2='$fromx2',url3='$url3',mess3='$mess3',fromx3='$fromx3'
where id='$id'" ;
$result=mysql_db_query("elong",$query); //执行写入
if (!$result)
{echo "发生错误!";
exit();
}
echo "$id 已经更新!<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
echo "<a href='set.htm'>回到首页</a>";
exit();
}
$query="SELECT id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg
where id='$id'" ;
$result=mysql_db_query("elong",$query);
if (!$result)
{echo "发生错误!";
exit();
}
$r=mysql_fetch_array($result);
$id = $r["id"];
$url = $r["url"];
$mess = $r["mess"];
$fromx = $r["fromx"];
$url1 = $r["url1"];
$mess1 = $r["mess1"];
$fromx1 = $r["fromx1"];
$url2 = $r["url2"];
$mess2 = $r["mess2"];
$fromx2 = $r["fromx2"];
$url3 = $r["url3"];
$mess3 = $r["mess3"];
$fromx3 = $r["fromx3"];
echo"
<form action='ww.php' method='post'>n
<table>n
<tr>n
<td>ID:<td> <input type=text name='id' value='$id'></tr>n
<tr>n
<td>类形:<td> <input type=text name='jpg' value='$jpg'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url' size='100' value='$url'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess' size='100' value='$mess'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx' size='100' value='$fromx'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url1' size='100' value='$url1'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess1' size='100' value='$mess1'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx1' size='100' value='$fromx1'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url2' size='100' value='$url2'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess2' size='100' value='$mess2'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx2' size='100' value='$fromx2'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url3' size='100' value='$url3'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess3' size='100' value='$mess3'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx3' size='100' value='$fromx3'></tr>n
</table>n
<input type=submit value='更新'>n
</form>n";
}
else
{?>
<h3>请输放需要更改的id:</h3>
<center><form action='ww.php' method='post'>
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg" checked>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg1">
明星写真
<input type="radio" name="jpg" value="jpg2">
广告创意
<input type="radio" name="jpg" value="jpg3">
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<input type=text name='id'>
<input type=submit value='查询'>
</form></center>
<?}?>
</body>
</html>
<html>
<body>
<h1>数据库的数据更新</h1>
<?
if(isset($id))
{
if(!mysql_connect("localhost","用户名","密码"))
{echo"无法联接数据库";
exit();
}
if(isset($url))
{
$query="update $jpg set id='$id',url='$url',mess='$mess',
fromx='$fromx',url1='$url1',mess1='$mess1',fromx1='$fromx1',url2='$url2',
mess2='$mess2',fromx2='$fromx2',url3='$url3',mess3='$mess3',fromx3='$fromx3'
where id='$id'" ;
$result=mysql_db_query("elong",$query); //执行写入
if (!$result)
{echo "发生错误!";
exit();
}
echo "$id 已经更新!<br><br>";
echo "<table>n
<tr>n
<td>ID<td>$id</tr>n
<tr>n
<td>url地址<td>$url</tr>n
<tr>n
<td>小图<td>$mess</tr>n
<tr>n
<td>说明<td>$fromx</tr>n
<tr>n
<td>url地址1<td>$url1</tr>n
<tr>n
<td>小图1<td>$mess1</tr>n
<tr>n
<td>说明1<td>$fromx1</tr>n
<tr>n
<td>url地址2<td>$url2</tr>n
<tr>n
<td>小图2<td>$mess2</tr>n
<tr>n
<td>说明2<td>$fromx2</tr>n
<tr>n
<td>url地址3<td>$url3</tr>n
<tr>n
<td>小图3<td>$mess3</tr>n
<tr>n
<td>说明3<td>$fromx3</tr>n
</table>n";
echo "<a href='set.htm'>回到首页</a>";
exit();
}
$query="SELECT id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg
where id='$id'" ;
$result=mysql_db_query("elong",$query);
if (!$result)
{echo "发生错误!";
exit();
}
$r=mysql_fetch_array($result);
$id = $r["id"];
$url = $r["url"];
$mess = $r["mess"];
$fromx = $r["fromx"];
$url1 = $r["url1"];
$mess1 = $r["mess1"];
$fromx1 = $r["fromx1"];
$url2 = $r["url2"];
$mess2 = $r["mess2"];
$fromx2 = $r["fromx2"];
$url3 = $r["url3"];
$mess3 = $r["mess3"];
$fromx3 = $r["fromx3"];
echo"
<form action='ww.php' method='post'>n
<table>n
<tr>n
<td>ID:<td> <input type=text name='id' value='$id'></tr>n
<tr>n
<td>类形:<td> <input type=text name='jpg' value='$jpg'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url' size='100' value='$url'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess' size='100' value='$mess'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx' size='100' value='$fromx'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url1' size='100' value='$url1'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess1' size='100' value='$mess1'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx1' size='100' value='$fromx1'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url2' size='100' value='$url2'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess2' size='100' value='$mess2'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx2' size='100' value='$fromx2'></tr>n
<tr>n
<td>图片url地址:<td> <input type=text name='url3' size='100' value='$url3'></tr>n
<tr>n
<td>说明:<td> <input type=text name='mess3' size='100' value='$mess3'></tr>n
<tr>n
<td>来自:<td> <input type=text name='fromx3' size='100' value='$fromx3'></tr>n
</table>n
<input type=submit value='更新'>n
</form>n";
}
else
{?>
<h3>请输放需要更改的id:</h3>
<center><form action='ww.php' method='post'>
<br>
动漫桌布
<input type="radio" name="jpg" value="jpg" checked>
平分秋色水彩画
<input type="radio" name="jpg" value="jpg1">
明星写真
<input type="radio" name="jpg" value="jpg2">
广告创意
<input type="radio" name="jpg" value="jpg3">
其它类
<input type="radio" name="jpg" value="jpg4">
<br>
<input type=text name='id'>
<input type=submit value='查询'>
</form></center>
<?}?>
</body>
</html>
标签:
php桌面中心(三),修改数据库
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月15日
2024年11月15日
- 炉石传说月初最强卡组有哪些 2024月初最强上分卡组推荐
- 狼人杀亮相原生鸿蒙之夜 假面科技强势登陆华为生态
- 12小时光线挑战!AI画质专家才是大平层首选
- 2024游戏IP报告:1~9月规模1960亿 68%用户愿为之付费
- 群星.2024-今夜一起为爱鼓掌电视剧原声带【相信音乐】【FLAC分轨】
- BIGFOUR.2013-大家利事【寰亚】【WAV+CUE】
- 李美凤.1992-情深透全情歌集【EMI百代】【WAV+CUE】
- 田震2024-《时光音乐会》[金峰][WAV+CUE]
- 群星《监听天碟3》[LECD]限量版[WAV+CUE]
- 心妤《声如夏花HQ》头版限量编号[WAV+CUE]
- 群星《摇滚五杰》[低速原抓WAV+CUE][1.1G]
- 群星 《2024好听新歌30》十倍音质 U盘音乐 [WAV+分轨]
- 群星《试音草原·女声篇》经典蒙古民歌[WAV+CUE][1G]
- 陈慧娴《永远是你的朋友》头版限量编号MQA-UHQCD2024[低速原抓WAV+CUE]
- 曼丽·女人三十《如果·爱》限量1:1母盘直刻[低速原抓WAV+CUE]