Código PHP:
$sql="SELECT * FROM tareas2 where id_plantilla='$plantilla'";
$result=mysql_query($sql,$link);
$datos=array();
$fila=0;
while($row= mysql_fetch_assoc($result))
{
$id=$row['id'];
$sql= "insert into tareas (id_tarea, estado, id_proyecto) values
('$id', 'no iniciada','$proyecto')";
$rst=mysql_query($sql, $conexion);
if( !$rst ) {
die( "Ocurrio un error: " . mysql_error() );
}
}
Saludos.