PDO Exception errors

后端 未结 2 930
感情败类
感情败类 2021-01-17 01:55

Can someone help me whit these errors ?

My table is like this in my database :

Here is my code :



        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-17 02:09

    Level, Type these are MySQL reserved keywords. You need to enclosed them properly

         PDO::ERRMODE_EXCEPTION));
            $reponse= $bdd->query('SELECT `IR`,`Level`,`Type`,`ToBeAnalyzed`,`Supplier`,`Consequences`,`Remarks`,SUM(`Level`,`Type`,`Supplier`) AS sommeLvlTypeSup FROM andgate GROUP BY `IR`,`Level`,`Type`,`ToBeAnalyzed`,`Supplier`,`Consequences`,`Remarks` ORDER BY SUM(`Level`,`Type`,`Supplier`) ASC');
        while ($donnees = $reponse->fetch())
        {
            echo '

    '.$donnees['IR'].','.$donnees['Level'].','.$donnees['Type'].','.$donnees['ToBeAnalyzed'].','.$donnees['Supplier'].','.$donnees['Consequences'].','.$donnees['Remarks'].','.$donnees['sommeLvlTypeSup'].'

    '; } } catch(PDOExpection $px) { echo $px->getMessage(); } ?>

    Reference: https://dev.mysql.com/doc/refman/5.7/en/keywords.html

提交回复
热议问题