Jump to content

problame in foreach loop


popmotsy

Recommended Posts

hi to all....every time in foreach loop i got that message::Invalid argument supplied for foreach() in C:\wamp\www\cpv\user\view_report.php on line 208.....

 

and  the code is;;

 

if(isset($_POST['submit12']))

{

//echo "qqq";

 

//print_r ("...".$_POST['score']."...");

$score=$_POST['score'];

//count($score);

 

foreach ($score as $row=>$name)

 

 

{

 

//$custmername= mysql_real_escape_string($name);

$sc=mysql_real_escape_string($name);

 

//echo "sss";

//$scr=$_POST['score'];

 

$sql="insert into cpv_feedback set score='$sc'";

//print_r($sql);

 

 

$res=mysql_query($sql)or die(mysql_error());

 

}

}

if($res)

{

echo " Your Data Has Been Updated Successfully";?>

 

<?php }

 

 

?>

 

 

can any one suggest me the solution for this warning message....thanks... ???

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/152348-problame-in-foreach-loop/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.