guoxin Posted February 12, 2008 Share Posted February 12, 2008 Hi All, May i know how to rectify the following php error? Thanks folks Warning: Invalid argument supplied for foreach() in /home/alan/do_add-user.php on line 36 do_add-user.php.php on line 304: $project_array = $_POST[Project]; 304 foreach($project_array as $project){ $sql3 = "INSERT INTO Mapping SET user_id='$uid', project_id='$project'"; $result3 = @mysql_query($sql3,$connection) or die(mysql_error()); } Link to comment https://forums.phpfreaks.com/topic/90648-warning-invalid-argument-supplied-for-foreach/ Share on other sites More sharing options...
aschk Posted February 12, 2008 Share Posted February 12, 2008 Simple, $project_array is NOT an array, as the php error tells you. So make it an array, or find out why it's not one. Link to comment https://forums.phpfreaks.com/topic/90648-warning-invalid-argument-supplied-for-foreach/#findComment-464693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.