dongwei4444 2013-05-10 13:50
浏览 103

如何在界面显示隐藏mySQL错误? [关闭]

I have this error in my webpage.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like ''' at line 1

However, I want to ignore this error because it does not influence my output. Therefore, I want to hide this error from displaying on user side.

I tried to use this code error_reporting(E_ALL ^ E_NOTICE);to hide this error, but only can hide "notice" error.

Any suggestion / solution to hide above error?

  • 写回答

2条回答 默认 最新

  • dsuxcxqep31023992 2013-05-10 13:54
    关注

    Theoretically, You can use "@" sign before function call to prevent from showing any errors. Example,

    $result = @$mysqli->query($query);
    

    But I would strongly suggest fixing that error.

    评论

报告相同问题?