What is the difference between mysql_real_query and mysql_query? I’ve made a quick google search but could not find any link that shows the difference between the two.
What is the difference between mysql_real_query and mysql_query ? I’ve made a quick google
Share
mysql_real_query() doesn’t exist in PHP. However, mysqli_real_query() exists.
According to the official MySQL manual (the C API): http://dev.mysql.com/doc/refman/5.0/en/mysql-real-query.html
About your second issue, the best way to insert multiple records is to create an INSERT query with multiple values:
And so on.
This will insert all the new rows in 1 operation, so it should be faster than running 3 queries, one per each row.
PS: You should consider using an extension that supports prepared statements, like MySQLi (note the i) or, even better, PDO.
Not only prepared statements are safer (if you use them correctly, they’re 100% safe against SQL injections), but also let you do things like those you see in the examples in this page: https://www.php.net/manual/en/pdo.prepare.php (you can do that with INSERT queries as well, of course). Ah, and PDO is also object-oriented, which is nice 🙂