hey guys,
need help on this code:
[CODE=perl]
$sth = $dbh->prepare("SELEC T * FROM `mml log` WHERE Commands LIKE '%$IMSI%'");
$sth->execute();
my $numFields = $sth->{'NUM_OF_FIELD S'};
while (my $ref = $sth->fetchrow_array ref){
print "--------------------------------------------------------------------------------";
for (my $i=0; $i<$numFields; $i++){
printf ("%s %s", $i ? "," : "", $$ref[$i]);
}
print "--------------------------------------------------------------------------------";
}
[/CODE]
this is a code to fetch a row from MySQL
just would like to know...what those $i, ?, "," : "" within the bracket means?
also this will print if my database finds a record
if say it can't find a record, i want to print "Records not found"
but now do i determine if the row is empty, contains nothing
need help on this code:
[CODE=perl]
$sth = $dbh->prepare("SELEC T * FROM `mml log` WHERE Commands LIKE '%$IMSI%'");
$sth->execute();
my $numFields = $sth->{'NUM_OF_FIELD S'};
while (my $ref = $sth->fetchrow_array ref){
print "--------------------------------------------------------------------------------";
for (my $i=0; $i<$numFields; $i++){
printf ("%s %s", $i ? "," : "", $$ref[$i]);
}
print "--------------------------------------------------------------------------------";
}
[/CODE]
this is a code to fetch a row from MySQL
just would like to know...what those $i, ?, "," : "" within the bracket means?
also this will print if my database finds a record
if say it can't find a record, i want to print "Records not found"
but now do i determine if the row is empty, contains nothing
Comment