在php中为何一定要赋值,我在asp中都是这样写就可以了(<%=rs("name")%>),只要sql查询语句写对了就会显示所需数据的,为何在php中还要赋值,不解,还请指教。

解决方案 »

  1.   

    没有赋值的变量为空,自然什么都没有。asp也不可能杜撰一个值用以输出吧?
      

  2.   

    $sql="select * from dbuser wheree id=30";
    上面的sql 语句你没看吗,有错误啊
    应该是:
    $sql="select * from dbuser where id=30";wheree应该改为where
      

  3.   

    $sql="select * from dbuser wheree id=30";
    上面的sql 语句你没看吗,有错误啊
    应该是:
    $sql="select * from dbuser where id=30";wheree应该改为where
      

  4.   

    (<%=rs("name")%>)
    你的ASP的这个rs("name")相当于PHP的$myrow["name"]
      

  5.   

    应该是这样的
    帐 号:</td>
                                <td height=25 width=245><?echo $myrow['name']?></td>
    其它的类推