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()); } Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.