Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: [jean] Query help?

Quote Reply
Re: [jean] Query help? In reply to
Oh - I must have a version different than what you have? I do not have an admin panel or templates?

Is there a way to modify what I have to accomplish what I am trying to do?

Code:
$dbh = DBI->connect (@db_connect) or &cgierr ("Connection Error. Reason: " . $DBI::errstr . "\n.");
$query = qq~
SELECT
date_exp,
TO_DAYS(date_exp) - TO_DAYS(CURRENT_DATE) AS days
FROM $db_table
WHERE date_exp between CURDATE() and DATE_ADD(CURDATE(), INTERVAL 1 MONTH)
ORDER BY date_exp
~;
$sth = $dbh->prepare ($query) or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
$sth->execute or &cgierr("Unable to query database. Reason: $DBI::errstr. Query: $query");
while (@tmp = $sth->fetchrow_array) {

Here is where I get lost - I don't know how to get it to compare the date_exp of the member who is logged in and the list that I just retrieved in this query


}


$sth->finish;
$dbh->disconnect or &cgierr ("Can't Disconnect. Reason: $DBI::errstr\n. Query: $query");


--------------------------
donm

Last edited by:

donm: Nov 26, 2001, 6:13 PM
Subject Author Views Date
Thread Query help? donm 5201 Nov 26, 2001, 2:47 PM
Thread Re: [donm] Query help?
jean 5065 Nov 26, 2001, 4:36 PM
Thread Re: [jean] Query help?
donm 5071 Nov 26, 2001, 5:01 PM
Thread Re: [donm] Query help?
jean 5072 Nov 26, 2001, 5:54 PM
Thread Re: [jean] Query help?
donm 5040 Nov 26, 2001, 6:02 PM
Post Re: [donm] Query help?
donm 5053 Nov 28, 2001, 11:07 AM
Thread Re: [jean] Query help?
Reena0330 4805 Sep 10, 2002, 1:33 PM
Thread Re: [Reena0330] Query help?
jean 4797 Sep 10, 2002, 1:59 PM
Post Re: [jean] Query help?
Reena0330 4810 Sep 12, 2002, 11:10 AM
Post Re: [jean] Query help?
Reena0330 4852 Aug 15, 2002, 1:53 PM