I'm not sure what you mean by DBD, but in case I'm right...lol....

I'm using MS Access from Office 97 on a Windows 98 server running Apache.

My code works fine unless I go over 6 in my select statement ie.:

$sqlstatement="SELECT pid, name, description, picture, price, sold FROM
gallery ORDER BY pid";

What I want to do is split the picture field into two fields...one for the
big picture one for the smaller thumbnail picture.  But not just limited to
that...I'd like to have room to expand the database in case I need to.

Thanks for your help.

-Dave


###CODE###

#!c:\perl\bin\perl -w

use DBI;
$dbh = DBI->connect('dbi:ODBC:gallery'); 
print "Content-type: text/html\n\n";
print qq~<LINK HREF="/wholesalegallery/wg.css" REL="stylesheet" TYPE="text/css">~;
print qq~<HTML>\n~; 
print qq~<BODY>\n~;                                  
#print qq~<CENTER>\n<H1>Online Gallery</H1>\n</CENTER>\n~;


$sqlstatement="SELECT pid, name, description, picture, price, sold FROM gallery ORDER 
BY pid";
$sth = $dbh->prepare($sqlstatement);              
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";


print qq~<FORM NAME = GALLERY>\n~;
print qq~<TABLE WIDTH = 100% BORDER = 0>\n~;
while (@row=$sth->fetchrow_array)
{
 print qq~<TR><TD ROWSPAN = 6>$row[3]</TD><TD = 50%>Product ID: $row[0]</TD>\n~;
 print qq~<TR><TD WIDTH=50%>Product name: $row[1]</TD></TR>\n~;
 print qq~<TR><TD WIDTH=50%>Description: $row[2]</TD></TR>\n~;
 print qq~<TR><TD WIDTH=50% VALIGN="top">Price: \$~;
 printf "%.2f", $row[4];
 print qq~ ~;
 print qq~</TD></TR>\n~;
 if ($row[5] == 1)
 {
  $sold = "yes";
 }
 print qq~<TR><TD WIDTH=50%><INPUT TYPE = CHECKBOX NAME = $row[0]>BUY<BR>\n~;
 if ($row[5] == 1)
 {
  print qq~<TR><TD><H3>SOLD OUT</H3><BR></TD></TR>\n~;
 }
 else
 {
  print qq~<TR><TD><H4>FOR SALE</H4><BR></TD></TR>\n~;
 }
 print qq~<TR><TD COLSPAN = 2><HR></TD></TR>\n~;
 $sold = "no";
}
print qq~</TABLE>\n~;
print qq~</FORM>\n~;
print qq~</BODY>\n~;
print qq~</HTML>\n~;    


----- Original Message -----
From: Mel Matsuoka <[EMAIL PROTECTED]>
To: SAWMaster <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 10:56 AM
Subject: Re: DBI limitations


> At 03:34 PM 09/19/2001 -0500, SAWMaster wrote:
> >Hello, can someone tell me why DBI can only handle 6 fields?
>
> No, because it can handle much more than 6 fields :)
>
> >I have a data base table that has more than 6, and I don't
> >know how I'm going to accommodate it all in my cgi script.
>
> Please show us your code so we can help you better. I have used DBI for
> everything as simple as a 3 field table all the way up to a ridiculous 20
> field table, so your problem is almost certainly an issue with errors in
> your Perl code, and not DBI itself.
>
> What DBD are you using, btw?
>
> Aloha,
> mel
>
>
>
> --
> mel matsuoka                    Hawaiian Image Productions
> Chief Executive Alphageek              (vox)1.808.531.5474
> [EMAIL PROTECTED]                  (fax)1.808.526.4040
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to