0

I am setting up a couple of MySQLi multi_query function. I know you can't use prepared statements with multi_query, so I wanted to know what security precautions is recommended to use with muti_query.

real_escape_string()?

ATLChris
  • 3,198
  • 7
  • 39
  • 65

2 Answers2

1

In fact, [mysqli_]real_escape_string() has nothing to do with security. It's more like syntax formatter.

For the complete guide on securing queries refer to this my answer: In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression?

Community
  • 1
  • 1
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
0

Pretty much yes. Especially given, that multi_query() allows for 'exploits of a mum' type of injection. So yeah:

  1. Escape strings
  2. Cast inetgers to integers and floats to floats
  3. If possible, assign your application privileges to SELECT, UPDATE, INSERT and DELETE only.
Mchl
  • 61,444
  • 9
  • 118
  • 120