Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Net::MySQL; our $mysql = Net::MySQL->new( hostname => "$Hostip", database => 'DB', user => 'test123', password => 'test123' ); my (@value) = selectRecord('MASTER','USER_NAME',"USER_ID = 'test' AND +DELETED=0"); print "@value\n"; sub selectRecord { my($TableName,$FieldName,$Condition)=@_; my(@Result); $mysql->query(qq{SELECT $FieldName from $TableName where $Conditio +n}); if ($mysql->is_error) { my $DBError = $mysql->get_error_message; print "$DBError\n"; return(0); } else { my $RecordSet = $mysql->create_record_iterator; while (my $Field = $RecordSet->each) { push(@Result ,$Field->[0]); } } #Sorting arrays @Result = sort {uc($a) cmp uc($b)} @Result; return(@Result); } $mysql->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: probelm with Net::MySQL
by Krambambuli (Curate) on May 11, 2007 at 09:08 UTC | |
|
Re: probelm with Net::MySQL
by Anonymous Monk on Aug 12, 2007 at 15:05 UTC | |
|
Re: probelm with Net::MySQL
by chrism01 (Friar) on May 14, 2007 at 05:00 UTC |