Date Range
Hi all, I am trying to get my mysql database to be searchable by date, by both current and past events. My perl program doesn't compile--- here's an excerpt-- package Date::Range; my $range = Date::Range - new ($date1, $date2); error message: -- can't locate object method new via package Date::Range Thanks for your help. Melissa Stranzl __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
SELECT * WHERE DATE TODAY
I am trying to get my program to be searchable by date, but it doesn't work. I get an error message in perl, that follows the code I included. Any suggestions are greatly appreciated. PERL -- @currenttime= localtime(); $y= $currenttime [5] + 1900; $m= $currenttime [4]; $dom= $currenttime [3]; $ydoy= $y*1000 + $m + $dom; print $ydoy; my $dbh= DBI-connect ('DBI:mysqlPP:myd:localhost', 'pass', 'pass') ||die Could not connect to database: .DBI-errstr; my $sth = $dbh-prepare(SELECT * from food WHERE end_date $ydoy); $sth-execute($ydoy); while((end_date $ydoy) = $sth-fetchrow_array) { print $start_date\n, $end_date\n, $event\n, $id; } die $sth-errstr if $sth-err; $sth-finish(); $dbh-disconnect(); ERROR MESSAGE: -- can't modify generic gt()) in list assignment at line 31 (which is the fetchrow_array line) repeated HERE: while((end_date $ydoy) = $sth-fetchrow_array) { print $start_date\n, $end_date\n, $event\n, $id; } Thanks again for your help. Melissa Stranzl 917-922-7872 __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Need help connecting to local database with mysql
Hi all: I am sending a perl program I am trying to run which doesn't connect to the database. The error message is at the bottom of the e-mail. I think the program is going to the sock file and not TCP/IP and I don't know how to change this, but I'm not sure whether this is the error, so any help is much appreciated. Happy holidays. MVS. #!/usr/bin/perl -w package DBD::mysqlPP; use CGI':standard','-noDebug'; #feo4.pl my @row; $event=($row[0]); $location=($row[1]); $time=param($row[2]); $price=param($row[3]); $description=param($row[4]); $contact=param($row[5]); $day=param($row[6]); use DBI; my $dbh= DBI-connect ('DBI:mysqlPP:myd', 'umvs', 'umvs') ||die Could not connect to database: .DBI-errstr; print hello; my $sth = $dbh-prepare($sql) or die Can't prepare $sql: $dbh-errstr\n; my $sql=INSERT INTO event VALUES ('$location', '$time', '$description', '$price', '$day', '$event', '$contact'); $sth-execute(); if (my $sth-SQL($sql)){ print SQL failed; exit(); } #my @row; while(@row = my $sth-fetchrow_array()) { print qw($row[0]\t$row[1]\t$row[2]\n\t$row[3]\n\t$row[4]\n\t$row[5]\n\t$row[6]\n); } $sth-close(); $sth-finish(); $dbh-disconnect(); This is the error message I get when I compile the program: DBI-connect(myd) failed: Couldn't connect to /tmp/mysql.sock: at C:/Perl/site/ lib/DBD/mysqlPP.pm line 109 at feo4.pl line 19 Could not connect to database: Couldn't connect to /tmp/mysql.sock: at C:/Perl/ site/lib/DBD/mysqlPP.pm line 109 (in cleanup) Can't call method close on an undefined value at C:/Perl/ site/lib/DBD/mysqlPP.pm line 274. Thanks again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php