解决方案 »
- 急急急,提示JpGraph Error A plot has an illegal scale. 。。。。
- Ecshop这个问题怎么处理?
- 求greenamp 绑定域名问题,
- 救命啊。。。call to undefined function ImageCreate() in phpqrcode.php on line 985
- 武汉 失业了,散分,兼求工作
- phpmailer发信时遇见了一个很苦逼的问题
- PHP中 include 和 require的区别
- 如何在源码中找出sql语句的位置呢
- thinkphp的where条件无法用数组,求分析原因
- 写网页管理系统,使用php还是C#?
- php如何进行数据绑定
- PHP 怎么做XP下的新建,加载计划任务程序
你要单独写一个编辑页面。首先根据 $_GET['hid']把需要修改的数据取出来,通常放在页面表单form里然后让用户输入修改,再提交表单。服务器接收数据,修改
点击编辑按钮后,不能传递值啊
$db_host="127.0.0.1:3306";
$db_user="root";
$db_psw="";
$db_name="mysql";
$connection=mysql_connect($db_host,$db_user,$db_psw)or die("连接服务器失败");
mysql_select_db($db_name,$connection)or die("选择数据库失败");
//从数据库里去数据
$hid = !empty($_GET['hid'])?intval($_GET['hid']):0;
$hotel_id=$_GET['hotel_id'];
$start_date=$_GET['start_date'];
$end_date=$_GET['end_date'];
$content=$_GET['content'];
$source=$_GET['source'];
$s_type=$_GET['s_type'];
$MySql_update=mysql_query("update hotel_activities_2 set hotel_id='$hotel_id',start_date='$start_date',end_date='$end_date',content='$content',source='$source',s_type='$s_type' where h_id='$hid");
$result=mysql_query($MySql_update);
echo mysql_errno();
if ($result) {
echo '数据更新成功!';
}else {
echo '数据更新失败!';
}
大侠们帮帮忙
<table border=1 height=100 width=400 align="center">
<tr>
<td>hotel_id: </td>
<td> <input name="hotel_id" type="text" value='$rows[hotel_id]' size=45 /> </td>
</tr>
<tr>
<td>start_date: </td>
<td> <input name="start_date" type="text" value='$rows[start_date]'size=45> </td>
</tr>
<tr>
<td>end_date: </td>
<td> <input name="end_date" type="text" value='$rows[end_date]'size=45> </td>
</tr>
<tr>
<td>content: </td>
<td> <input name="animal" type="text" value='$rows[news_date]'size=45> </td>
</tr>
<tr>
<td>source: </td>";
<td> <input name="source" type="text" value='$rows[source]'size=45> </td>
</tr>
<tr>
<td>s_type:</td>
<td> <input name="s_type" type="text" value="$rows[s_type]"> </td>
</tr>
<tr>
<td> </td>
<td> <input name="submit" type="submit" value="用户更新"> <input name="fanhui" type="button" value="返回" onClick="window.open ('index_baocun.php')"></td>
</tr></table>
</form>