PHP Using Variables with INSERT INTO database

How to use variables for the table name, the columns you are inserting into the database and the values being inserted using the mysql INSERT INTO statement

Home Short:

In PHP using variables in an INSERT INTO statement to add data to a database is as simple as literally inserting the variables into the insert statement. You can use variables for the table name, the columns you are inserting into the database and the values being inserted.

Note how you do NOT need to use string concating periods and quotation marks ie ...

Look at this page on a function to safely, properly and securely use INSERT INTO in php and avoid things like sql injection and other hiccups.

S
H
A
R
E