develooper Front page | perl.beginners.cgi | Postings from December 2011

problem with passing variables

Thread Next
Mark Haney
December 30, 2011 08:17
problem with passing variables
Message ID:
I'm not sure if this is the right list for this, so bear with me.  If it 
isn't I'll be glad to post it on the correct one.

I've got a problem with passing variables to a SQL server inside a CGI 
script.  My code is like this:

my $begin_time = "2011-11-16 11:00:00";
my $end_time = "2011-11-16 12:00:00";

my $dbh = DBI->connect('dbi:mysql:database=embdev', 'user', 'password');

my $sql = q/SELECT * FROM events WHERE date BETWEEN $begin_time and 

my $sth = $dbh->prepare($sql);

I'm not sure why it's not using the the variables, can someone point out 
what I'm doing wrong?

Mark Haney

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About