문제

Every time I try mysql(i)_real_escape_string the value put into the MySQL table cell is empty. Always. Anyone help? I use the object orientated version of it and I tried the exactly same code with that function and without it, and it worked perfectly when it was not there.

도움이 되었습니까?

해결책

Three rules to get it right:

  1. do not use this function in the application code
  2. do not put your variables directly into query but use prepared statements
  3. do not use raw mysqli in the application code but use some higher level abstraction, at least PDO
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top