Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie Problem!!

Status
Not open for further replies.

Blood22

Technical User
Jul 14, 2003
7
GB
I am creating a booking schedule. When someone books a specific date and time, I hope to show the results to the administrator in the form of a schedule table. However currently I have managed to get the select statement to work and change the background colour of a specific cell.

I was wondering if anyone knew a way in which I could put many select statements into the one table, as the problem at the moment is that if I had 2 select statements for example 10 o clock and 1 o clock, it would produce 2 seperate html tables!

Sorry for trying to describe my problem poorly but...
here is the code so far!:

$dbh = DBI->connect($dsn, {RaiseError =>1});

$sth = $dbh->prepare("SELECT * FROM booking WHERE '$starttime 10:00:00'");

$sth->execute();

print "Content-type: text/html\r\n\r\n";
print "Results of booking search:";
print &quot;<br>&quot;;
while (my $hashref = $sth->fetchrow_hashref()) {
print &quot;<br>&quot;;
print &quot;<table width=100% border=1 bordercolor=#000000>&quot;;
...

then I list the table as a schedule, however every cell is white except the one that matches the select statement for example ..

print &quot;<td bgcolor=#ff0000>&nbsp;</td>&quot;;

then

$sth->finish();
$dbh->disconnect();
exit(0);

Any ideas or suggestions to help would be really appreciated!!!

Si22
 
It's been a while, but I think that it will not work like that. But rather:

select * from foo where bar = 'baz' OR bar = 'quux'

--jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top