i have been trying to do this multiple insert but does not get it right
PHP Code:
<?php
$sql = "SELECT * FROM table1 WHERE id IN ('$s_id')";
$result = mysql_query($sql) or die (mysql_error());
$msg = "hello world";
while($feed = mysql_fetch_array($result));
{
$id[] = $feed['id'];
$user_id[] = $feed['user_id'];
$notice = "INSERT INTO table2 (user_id, msg) VALUES ('$user_id, '$msg')";
$notify = mysql_query($notice) or die (mysql_error());
}
i want get it in such a way that
if $user_id contains 1,2,3,4 then this should be how the data should be inserted
id user_id msg
1 1 hello world
2 2 hello world
3 3 hello world
4 4 hello world