Answer the question
In order to leave comments, you need to log in
Do I need to write or die in a sql query?
In PHP, I write sql queries like this:
I saw that others add this thing to the query: or die("Can't connect."). Does it need to be written? Necessarily?
I also write at the end: , $db). And is it necessary?
Answer the question
In order to leave comments, you need to log in
or die are added when you need to stop the script on an error, and in brackets the actual text that will be displayed. But, as colleagues unsubscribed above, it is better to use PDO
Boy, in what library did you find that ancient sinister spellbook of black sorcerers?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question