If php code like below how it's like as mysql store procedure equvilant.If any links tutorial on advance store proc mysql please put.
$sql=" SELECT a,b FROM j ";
$result=mysql_query($sql);
if(mysql_num_rows($result) > 0 ) {
while($row=mysql_fetch_array($result)) {
$sql_update="UPDATE b set a=".$row['a']."'";
mysql_query($sql_update);
}
}