本帖最后由 haihao_110 于 2010-08-03 10:12:44 编辑

解决方案 »

  1.   

    upedit.php?hid=……这个链接点过去,只能取到 $_GET['hid'];的值其他的不在超链接里,不能取到值的。
    你要单独写一个编辑页面。首先根据 $_GET['hid']把需要修改的数据取出来,通常放在页面表单form里然后让用户输入修改,再提交表单。服务器接收数据,修改
      

  2.   

    <a href="up_load.php?hid=' . $row['h_id'] . '">编辑</a>
    点击编辑按钮后,不能传递值啊
    $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 '数据更新失败!'; 

    大侠们帮帮忙
      

  3.   

    <form action="upedit.php" method="get">
    <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>