MySQL语法错误代码页面

时间:2014-02-22 20:32:41

标签: php mysql

只是想知道是否有人发现我的错误我真的看不到它但我的页面上的sql代码从get_sql开始谢谢

<?
    if (!empty($item_details[$counter]['name'])) {

        $main_image = $db -> get_sql_field("SELECT media_url FROM " . DB_PREFIX . "auction_media WHERE
            auction_id='" . $item_details[$counter],['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1", 'media_url');

        $auction_link = process_link('auction_details', array('name' => $item_details[$counter]['name'], 'auction_id' => $item_details[$counter]['auction_id']));?>

4 个答案:

答案 0 :(得分:0)

你的错误在这里你有额外的逗号

 WHERE auction_id='" . $item_details[$counter],['auction_id'] . "'

更改为

 WHERE auction_id='" . $item_details[$counter]['auction_id'] . "'

尝试这个

    $main_image = $db->get_sql_field("SELECT media_url FROM " . DB_PREFIX . "auction_media WHERE
        auction_id='" . $item_details[$counter]['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1");

答案 1 :(得分:0)

更改

auction_id='" . $item_details[$counter],['auction_id'] . "'

auction_id="' . $item_details[$counter]['auction_id'] . '"

这里你需要来覆盖你的字符串而不是'&amp;也可以将逗号作为 echo_Me 表示

答案 2 :(得分:0)

有一个拼写错误:

$item_details[$counter],['auction_id']

只需删除逗号即可。

答案 3 :(得分:0)

未定义变量:大约12但我刚刚意识到我的所有错误都已连接我的模板没有收到变量这个函数是问题`函数集($ name,$ value){$ this-&gt; vars [$ name] = $ value; }

当我打印请求时,我得到了这个 会话对象 (     [vars] =&gt;排列         (             [0] =&gt;         )

    ## assign variables that will be used in the template used.
function set($name, $value)
{
    $this->vars[$name] = $value;

}

## process the template file
function process($file)
{
    @extract($this->vars);
    ob_start();
    include($this->path . $file);
    $contents = ob_get_contents();
    ob_end_clean();

    return $contents;

}