2013-07-20 50 views
0

在我的舊網站中,此問題不存在。但是當我更改了服務器並導入了數據庫後,就會出現此消息。 PHP的版本是5.3,這是代碼:「數據庫導入後出現操作排序的非法混合'concat'」

$sql = "SELECT * FROM movcaixa 

    WHERE data BETWEEN '$data1' AND '$data2' AND empresa = $empresa 

    ORDER BY data ASC"; 
    $resMovCaixa = mysql_query($sql, $cnn) or die('Falha na conexão com o banco de dados'); 
    $sql = "SELECT cp.id AS codigo, CONCAT('Pagamento ref. a ', des.descricao, ', conforme doc. nº ', cp.documento) AS hist, DATE_FORMAT(cp.quitacao, '%d/%m/%Y') AS data, cp.valorpago AS vlr, cp.documento AS doc, fr.nome AS forn, des.descricao AS desp 

    FROM contaspagar cp, fornecedor fr, despesa des 

    WHERE cp.fornecedor = fr.id AND cp.despesa = des.id AND cp.quitacao BETWEEN '$data1' AND '$data2' AND empresa = $empresa 

    ORDER BY data ASC"; 
    $resContasPagar = mysql_query($sql, $cnn) or die(mysql_error($cnn)); 
    $sql = "SELECT cr.id AS codigo, DATE_FORMAT(cr.quitacao, '%d/%m/%Y') AS data, CONCAT('Recebimento ref. ', cli.nome, ', conforme doc. ', cr.documento) AS hist, cr.valorpago AS vlr, cr.documento AS doc, cs.descricao AS cont 

    FROM contasreceber cr, contratoservico cs, cliente cli 

    WHERE cr.contratoservico = cs.id AND cs.cliente = cli.id AND cr.quitacao BETWEEN '$data1' AND '$data2' AND empresa = $empresa 

    ORDER BY cr.quitacao"; 

有人能幫助我嗎?

回答

0

檢查歸類爲表,你CONCAT函數內部使用:

  1. DES
  2. CP
  3. CLI
  4. CR

使用相同的排序規則對所有的人。

相關問題