@mysql_connect and mysql_connect

后端 未结 5 1479
野趣味
野趣味 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:12

    That is an error suppression mechanism. So, say there was an an error when you tried to connect, PHP would silently ignore it rather than displaying/logging it (depending on your settings).

    I personally think it bad practice to use this, as, in my opinion, you should write your code to handle errors, not just silently discard them.

提交回复
热议问题