Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 1
    and the query should really be 'INSERT INTO table (text, category) VALUES '.implode(','. $sql)' sigh 4am coding leads to terrible debugging :( Commented Apr 23, 2009 at 3:44
  • 1
    @staticsan: Thanks a lot! Superb Technique! Had a really significant speedup! Commented Sep 13, 2010 at 4:32
  • 3
    I believe this code will create a solution for my latest project. My question here is, is this safe from SQL injection? My plans are to switch out mysql_real_escape_string with mysqli_real_escape_string and mysql_query with mysqli_queryas I'm using MySQLi and these have been deprecated as of PHP5. Many thanks! Commented Jan 24, 2014 at 18:11
  • 2
    This query is vulnerable to sql injection! Commented Dec 9, 2015 at 9:50
  • 3
    mysql_* has been removed from PHP, so be sure to use the mysqli_* interface. Commented Nov 3, 2018 at 16:37