In your retrieval of the values, i believe you would need to store the results in an array, since you are returning more than one value. So in your example.$row[1] would be your person value.....it should look like...

while(my @row = $sth->fetchrow_array)
{
  print "<td class=\"cellDetail\" valign=\"top\" >$row[1]</td>";
}


As for the select statement itself, you probably should use the dbh->quote function to have the db properly quote your variables before you use them.
Hope that helps,
Chris


btw.. take a look at the cgi modules. you wont have to write html code like that again! :)

--
-------------------------------
Just Your Friendly Neighborhood
_SPIDEY_


mark o' sullivan wrote:


Hi,
This may be a very simple problem but I just can't see the solution. I'm
trying to select a person's name from a database table but it quits once it
reachs an entry where no person's name exists. Without pre-populating the
table is there a way around this; just selects all a columns details
whether empty or not?

code:

# prepare and execute query
my $sth = $dbh->prepare("SELECT Time,Person
                        FROM bookingform
                        WHERE Date = '$totalYear'");
$sth->execute();

while(my $Person = $sth->fetchrow_array)
{
  print "<td class=\"cellDetail\" valign=\"top\" >$Person</td>";
}

$totalYear is a certain value.
$Person is sometimes empty though. Thanks in advance,
Mark.



********************************************************************** This document is strictly confidential and is intended for use by the addressee unless otherwise indicated. Allied Irish Banks **********************************************************************







-----------------------------------------
The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer.


Thank you. Paychex, Inc.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to