jonaofarc Posted November 23, 2008 Share Posted November 23, 2008 so I have an array that goes like like this 2,42,78,2 how can can I break it apart so that I can do a mysql entry intro each of those rows, what i mean is mysql_query("INSERT INTO message WHERE user_id=2")" mysql_query("INSERT INTO message WHERE user_id=42")" mysql_query("INSERT INTO message WHERE user_id=78")" mysql_query("INSERT INTO message WHERE user_id=2")" Link to comment https://forums.phpfreaks.com/topic/133868-solved-so-i-have-an-array-that-goes-like-like-this-242782-how-can-can-i/ Share on other sites More sharing options...
redarrow Posted November 23, 2008 Share Posted November 23, 2008 what u mean? Link to comment https://forums.phpfreaks.com/topic/133868-solved-so-i-have-an-array-that-goes-like-like-this-242782-how-can-can-i/#findComment-696855 Share on other sites More sharing options...
trq Posted November 23, 2008 Share Posted November 23, 2008 $array = array(2,42,78,2); foreach ($array as $k) { mysql_query("INSERT INTO message WHERE user_id=$k"); } Link to comment https://forums.phpfreaks.com/topic/133868-solved-so-i-have-an-array-that-goes-like-like-this-242782-how-can-can-i/#findComment-696859 Share on other sites More sharing options...
jonaofarc Posted November 23, 2008 Author Share Posted November 23, 2008 thanks so much Link to comment https://forums.phpfreaks.com/topic/133868-solved-so-i-have-an-array-that-goes-like-like-this-242782-how-can-can-i/#findComment-696888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.