I have little confusion in foreach loop.
There is a foreach in my below code:
foreach ($myrows as $rows){
$option = $rows->option_value;
$option_value = recursive_unserialize_replace($site_url,$_POST['url_name'],$option);
$sql.= '('."'".$rows->option_name."'".','."'".$option_value."'".','."'".$rows->autoload."'".')'.",";
}
Look at the line number 3. There is a comma I used to print. Now I do not want to print the comma in the last line.
Try this: