我建立了一个数据库,但是要在页面中修改数据库中的修改内容,应该怎        越简单越好 $sql="select * from 数据库 where 后面应该写什么?
$result=mysql_query($sql) or die(mysql_error());
$info=mysql_fetch_array($result);
  最好能写出来!        
      

解决方案 »

  1.   

      只要能在页面中修改title 就可以了。!传值接值都不怎么需要。就只需要修改数据库的简单代码就好了。最好是面向过程!能让人一看就明白。
      

  2.   

    这个都不需要了,你还怎么去改数据库?以下是个例子,你看看是不是你要的这种。
    HTML文件中如下:
    <html>
    ....
    <form name='form' id='form' action='test.php'>
    TITLE:<input type='text' name='title' id='title'>
    <input type='submit' name='sub' id='sub' value="提交">
    </form>
    ....</html>
    PHP文件如下:
    <?php
    require_once ("connect.php");
    $title=$_REQUEST["title"];
    mysql_select_db('test');
    $sql="select * from table1;";
    $update="update table1 set views='$title' where ID=1";
    mysql_query($update,$connect);
    $query=mysql_query($sql,$connect);
    while ($row=mysql_fetch_array($query))
    {
    echo '<pre>';
    print_r ($row);
    echo '</pre>';
    }?>
    效果描述:浏览器中127.0.0.1/test.html,输入一个标题,点提交,之后会显示出数据库中更改后的数据信息。