in reply to fetchrow_array DBI
Check DBI, which should be your #1 reference in this matter :) The POD is fairly extensive and quite readable.
fetchrow_array is part of the statement handle object, not the database handle object (if I get it right)
If you change your code to the following, it'll probably works:
use warnings; use DBI; use DBD::mysql; use CGI qw( :standard ); use CGI::Carp "fatalsToBrowser"; print header, start_html('SQL Must Work!'); # Great title ;) my $dbh = DBI->connect("DBI:mysql:data:server","uname","pass") or die( "Could not make connection to database: $DBI::errstr" ); # Slightly altering this my $sth = $dbh->prepare("SELECT Tab1, Tab2, Tab3 FROM UData"); $sth->execute; # Using $sth, instead of $dbh while (my @row = $sth->fetchrow_array ) { my ( $item0, $item1, $item2 ) = @row; if ($item0 >= $somevalue) { print br, "$item0"; } } warn( $DBI::errstr ) if ( $DBI::err ); $dbh->disconnect(); print '<h2>All Done</h2>'; print end_html;
HTH
|
|---|