3 ms·
Yet, this ancient library did not have serious issues. It was not deprecated because someone hacked it or it was even bad, but because it had not been maintaine
by buboard 8y ago
Yet, this ancient library did not have serious issues. It was not deprecated because someone hacked it or it was even bad, but because it had not been maintained for many years. The reason was probably that it did not need maintainance, it just worked, but programmers often used it in the wrong way. In fact, the removal from PHP has caused some very small and old projects to break, and IMHO php should not have removed it, for the sake of compatibility.
Also, it is much faster than the suggested alternative (pdo).
- bradleyjg 8y agoIt did have serious security issues. That’s why not long after there was another function added named mysql_real_escape_string.
- duskwuff 8y agoNo, that's not true. That function name was copied directly from the MySQL C API. It was not added by PHP. https://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-string.html https://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-st...
- bradleyjg 8y ago“You can use this function safely with your MySQL database queries if and only if you are sure that your database connection is using ASCII, UTF-8, or ISO-8859-* and that the backslash is your database's escape character. If you're not sure, then use mysqli_real_escape_string instead. This function is not safe to use on databases with multi-byte character sets.”
- buboard 8y agoyou're focusing on a function with a known limitation, that was superceded 15 years ago and practically everyone used mysql_real since then. That's not the reason why the module was removed though. The reason is that the mysql_* functions are "too low level for noobs". https://stackoverflow.com/questions/16859477/why-are-phps-mysql-functions-deprecated https://stackoverflow.com/questions/16859477/why-are-phps-my...