Skip to content
Advertisement

PHP: foreach insert into, a exploded-list

Everything seems correct, but nothing happens. I want to INSERT a PHP exploded keyword list. into the new table, (already working/ OK): product_keywords

JavaScript

from my old table PRODUCTS,

JavaScript

Where is the error(?)

explode echo TEST (already working/ OK)

JavaScript

html echo TEST result OK:

JavaScript

display input echo (already working/ OK)

JavaScript

not working, table is still empty PHP does not insert any content in the database. There must be a problem with “foreach” at this point.

JavaScript

Advertisement

Answer

Insert statements use VALUES, update statements use SET.

JavaScript

Should be

JavaScript

Also, you should be using prepared statements to protect from sql injection attacks.

How can I prevent SQL injection in PHP?

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement