This is a much more secure way to insert records and prevent MySQL injection. This assumes that $this-conn is your MySQLi PDO database connection object that you’ve already initialized:
Please note that a lot of the PHP snippets on this site assume you have some level of PHP experience. I use this site as a repository of many frequent code snippets and things I find I look up a lot as a central way to reference materials. Feel free to use and share as you see fit!
- Aaron Belchamber