> However, when I do a "random" query I get some blank > pages. I traced this to > the DBI Log using the "DBH->Trace(2, /tmp/DBI.log)". > I found that sometimes > the "execute()" returns "0E0". Does anybody knows > why??
If I remember rightly 0E0, in DBI, means "Success" ie : your query worked, but no rows were affected/returned. If there had been an error, "undef" would be returned. So for some reason your query is returning no rows. Can't immediately see why. (0E0 is evaluated as TRUE in a Boolean statement, "undef" as false.) HTH Henry > > I did a simple logic to check for the value return > by "execute()", if the > value is "0E0" then do the same query. Do this same > query until the value > return by "execute()" is not "0E0". However, I am > still getting blank pages. > > I am sending the actual script that I have been > working on to provide a > complete picture. > > Thank you in advanced > > -max > ====================SCRIPT========================== > 1 package DBNE2; > 2 > 3 use strict; > 4 use vars qw($DBH); > 5 use Apache; > 6 use DBI(); > 7 > 8 sub handler { > 9 $DBH = > DBI->connect("DBI:mysql:test","webuser","mult1scan") > > || die $DBH->errstr; > 10 my $r = shift; > 11 my $h = > $DBH->trace(2,"/tmp/DBNE2.log"); > 12 > 13 my $IdHandle = $DBH->prepare("SELECT > MAX(id) FROM webtest"); > 14 $IdHandle->execute; > 15 my $id = $IdHandle->fetchrow; > 16 > 17 my $RowHandlesth = > $DBH->prepare("SELECT * FROM webtest WHERE > id = ROUND( (RAND() * ?) + 1)"); > 18 $RowHandlesth->execute($id); > 19 > 20 while (! $RowHandlesth ) { > 21 $RowHandlesth->execute($id); > 22 > 23 if ( $RowHandlesth ) { > 24 # my @row = > $RowHandlesth->fetchrow; > 25 last; > 26 } > 27 } > 28 my @row = $RowHandlesth->fetchrow; > 29 > 30 $r->content_type("text/html"); > 31 $r->send_http_header; > 32 $r->print(@row); > 33 $RowHandlesth->finish; > 34 } > 35 > 36 1; __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com