Results 26 to 28 of 28
Mar 22, 2001, 00:16 #26Originally posted by ibeblunt
I meant I have to convert my dates and times to UnixTimeStamps. As of now I'm using just regular dates (ie 2001/03/23). Any more ideas?
Obviously you have the time/date of the current article either on MySQL date format or Unix timestamp (for displaying the date). You can compare the dates on the query.
You can use:
Getting the $curdate from the current table row.
$curdate = $row['articleDate'];
$NextLink = mysql_query('SELECT articleID from articles WHERE articleDate > ' . $curdate . ' LIMIT 1');
Mar 23, 2001, 16:07 #27
Just use int(10) fields and store the value returned by the php function time() directly. Then just repull it from the db, no need for UNIX_TIMESTAMP(date) as date anymore. Hope that helps.
Mar 23, 2001, 16:14 #28
- Join Date
- Aug 2000
- San Diego, CA
- 0 Post(s)
- 0 Thread(s)
Jack as a sidenote, by storing your dates in date columns you thereby have access to all of MySQL date functions for comparing adding subtracting, days weeks, years, its all there. When you store it in int(10) field you no longer have access to all those functions. Sure you can do it in PHP but then php gets bogged down, it an be done much eaiser and faster in the query itself.Please don't PM me with questions.
Use the forums, that is what they are here for.