Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [jean] Query help?: Edit Log

Here is the list of edits for this post
Re: [jean] Query help?
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

Edit Log: