Php错误行是红色的

时间:2011-02-28 05:32:32

标签: php

我有这段代码并给出错误,格式化的代码有什么问题?

 $row = intval( $cat_id )( "select cat_path,cat_name from sdb_goods_cat where cat_id=".intval( $cat_id ) );

  $row = intval( $cat_id )( "select cat_path from sdb_goods_cat where cat_id=".intval( $cat_id ) );

 $rs = intval( $catid )( "select tabs,cat_id from sdb_goods_cat where cat_id=".intval( $catid ) );

 $row = intval( $catid )( "select tabs,cat_id from sdb_goods_cat where cat_id=".intval( $catid ) );

  intval( $v )( "update sdb_goods_cat set p_order=".intval( $v )." where cat_id=".intval( $k ) );

  $row = intval( $id )( "SELECT count(*) AS num FROM sdb_goods_cat WHERE parent_id=".intval( $id ) );

 $rs = intval( $id )( "SELECT * FROM sdb_goods_cat WHERE cat_id=".intval( $id ) );

  $row = intval( $parent_id )( "SELECT parent_id, cat_path, p_order FROM sdb_goods_cat WHERE cat_id=".intval( $parent_id ) );

 $sDefine = intval( $data['cat_id'] )( "SELECT parent_id FROM sdb_goods_cat WHERE cat_id=".intval( $data['cat_id'] ) );

   $aCats = intval( $catid )( "SELECT * FROM sdb_goods_cat WHERE parent_id = ".intval( $catid ) );

  $row = intval( $catid )( "SELECT parent_id FROM sdb_goods_cat WHERE cat_id=".intval( $catid ) );

 intval( $catid )( "DELETE FROM sdb_goods_cat WHERE cat_id=".intval( $catid ) );
        intval( $catid )( "update sdb_goods set cat_id=\"0\" WHERE cat_id=".intval( $catid ) );

以上行代码在Dreamweaver中给出了错误行,我不知道为什么。请帮我找一下要改变的内容?

4 个答案:

答案 0 :(得分:2)

为什么您担心Dreamweaver会说什么,请在服务器上运行它。如果它在那里工作正常,那么没有问题。

顺便说一句,你应该把所有保留的MySQL关键字大写,比如“select”,“where”和“update”。

答案 1 :(得分:0)

$row = intval( $catid )( "SELECT parent_id FROM sdb_goods_cat WHERE cat_id=".intval( $catid ) );

我不确定你要做什么也许你的意思是这样的,加上调用应该像这样$a = intval($b);后面的()括号会产生语法错误。

$row = mysql_query('SELECT parent_id FROM sdb_goods_cat WHERE cat_id='.intval( $catid ));

另外,如果您没有插入任何变量,请尝试避免使用双引号,单引号会向您的读者指示他们不需要搜索任何插值。

答案 2 :(得分:0)

$row = intval( $cat_id )( "select cat_path,cat_name from sdb_goods_cat where cat_id=".intval( $cat_id ) );

你想做什么?看起来你正在使用变量,将其转换为整数,然后尝试将其称为带有SQL查询的函数。整数不是函数,所以这不起作用。 Dreamweaver可能会给你一个语法错误,因为你写的东西没有意义。

您可能希望像RageZ建议的那样使用mysql_query。重新思考你想要做的事情。

答案 3 :(得分:0)

事实证明,您使用的代码是盲目查找和替换的结果。像大多数人一样,我无法理解你想要写什么,正如Mark所说,在大写字母中使用MySQL关键字。 恕我直言,Dreamweaver是编写PHP代码/后端开发的不错选择,我使用Netbeans,免费,快速,优于DW。 DW是前端的绝佳产品。