my $in=join (", ", (map { $_ = "'$_'" } @one));
$sql="SELECT * FROM sistema WHERE codigo_inscripcion IN ($in) and mat
+ricula='$matricula'";
$pdbh=$dbh->prepare($sql);
$pdbh->execute();
# stuff here!
while (my $ref = $pdbh->fetchrow_hashref()) {
if($ref->{'mon'} != ''){$mon="Mon$ref->{'mon'})}
if($ref->{'tue'} != ''){$mar="Tue$ref->{'tue'}"}
if($ref->{'wed'} != ''){$mie="Wed$ref->{'wed'}"}
if($ref->{'thu'} != ''){$jue="Thu$ref->{'thu'}"}
if($ref->{'fri'} != ''){$vie="Fri$ref->{'fri'}"}
if($ref->{'sat'} != ''){$sab="Sat$ref->{'sat'}"}
if($ref->{'sun'} != ''){$dom="Sun$ref->{'sun'}"}
}
$pdbh->finish();
exit;
if ($mon ne ''){
$lun=~ /([A-Za-z]*)([0-9]*)\/([0-9]*)/;
for($z=$2;$z<$3;$z++) { push (@soft, "$1$z"); }
push (@soft, "$1$3");
print @soft;
exit;
Im trying with this... this is actually printing only 1 of the selections how I want... but I think this code stinks!
If I select more than one row, it overwrites the value of $mon and only shows me the last... I dunno how to do this! Please HELP! |