@mysql_connect and mysql_connect

后端 未结 5 1484
野趣味
野趣味 2021-02-06 01:22

I have no problem connecting to a database using PHP however in some scripts I have tested, I have seen a small difference in the connect command.

What is the differenc

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-06 02:09

    It is the/an error control operator. It simply allow you to suppress the error.

    I would suggest that you omit it in your code.

    From documentation:

    Currently the "@" error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use "@" to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.

提交回复
热议问题