[Solved] How to insert to a database with foreach? [closed]
You need to add the MySQL query inside the foreach() function, as well: foreach ($qurum as $value) { $query2 = “INSERT INTO test (data_id, col2) VALUES ($id, $value)”; mysqlExecute($query2); } Note that mysqlExecute() does not exist, you need to use your own function to execute the query. Also note that executing SQL statements in a … Read more