in reply to Perl and MySQL - getting a random record
I get the feeling that perhaps your browser is caching the image that the script returned the first time. Look into adding 'Cache-control', 'Pragma', and/or 'Expires' http headers. Looking at your code even further, where is $imageurl coming from in the Get_Banner_Rotator subroutine? I don't see that declared anywhere... Even worse now... you have a my ($dbh ...); at the top of the sub and then you use it as the database handle. You have to pass the db object into the sub.
As for the query you have to get a random row from the database, it's correct. I recommend cleaning up the code a bit first. As well, I'm not sure whether you already do or not, but I suspect that your script is missing -w and 'use strict'. Add those on if they are missing. They'll make your life so much easier :)
C:\>shutdown -s
>> Could not shut down computer:
>> Microsoft is logged in remotely.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl and MySQL - getting a random record
by powerhouse (Friar) on Feb 06, 2003 at 00:47 UTC |