Below code does not print contents of the select sql
statement to file ??

When I run a select on the table i get results in the
dos shell.

All the code below does is print column names and
nothing more ??

code:
open(file,">C:/perl/bin/mysql.txt") or warn "did not
open file\n";

undef $sql;

$sql = "   select * from regs   ";

  if ($db->Sql($sql)){
     print "SQL failed.\n";
     print "Error: " . $db->Error() . "\n";
     $db->Close();
     exit;
}

print file " ref                        cite                            reg            
                                         notes \n";
#  start while loop at line below ##
  while($db->FetchRow()){
     undef %Data;
     %Data = $db->DataHash();
     @data = %Data;

my $var1 =  $Data{ref};
my $var2 =  $Data{cite};
my $var3 =  $Data{reg};
my $var4 =  $Data{notes}; 

  print file "$Data{'ref'}   $Data{'cite'}  
$Data{'reg'}    $Data{'NOTES'}    \n";
# print file " '$var1'  $var2   $var3   $var4 \n";


}  # End of while loop

close(file);
$db->Close();

print " file located at C:/perl/bin/mysql.txt ";

=====
Regards,

Investorclb


=====
Regards,

Investorclb

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to