The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a PHP file that I run as a cron task every 24 hours. Can some one help with a tweak to the query to only select matches that have occurred between the time the query is executed and through 48 hours before?
PHP Code:
Code:
$urls = mysql_query("SELECT linkid,linkurl FROM adv_links ORDER by linkid ASC"); Any help would be appreciated! Thanks, |
#2
|
|||
|
|||
![]()
Is there a time column in your table?
|
#3
|
|||
|
|||
![]()
Yes there is - its "dateline" and as an example under PHPMyAdmin the field looks like "1207498258" for a particular entry. I am unsure how to read that with the SQL query and translate that to what I need.
Thanks for the reply, |
#4
|
|||
|
|||
![]() PHP Code:
|
#5
|
|||
|
|||
![]()
Thank you very much for the help. I'll give it a try.
|
#6
|
||||
|
||||
![]()
More easily done within mysql
...where unix_timestamp() - timecolumn <= 3600*48 |
#7
|
|||
|
|||
![]()
After many frustrating hours I'm still having a problem. I have tried multiple ways of writing the SQL query line but it still is not correct. I am using this code
PHP Code:
Thanks, |
#8
|
|||
|
|||
![]()
Try:
PHP Code:
|
#9
|
||||
|
||||
![]() Quote:
Quote:
Other thoughts? --------------- Added [DATE]1210086427[/DATE] at [TIME]1210086427[/TIME] --------------- Quote:
Thanks, --------------- Added [DATE]1210108992[/DATE] at [TIME]1210108992[/TIME] --------------- PHP Code:
Quote:
|
#10
|
||||
|
||||
![]()
"timecolumn" is whatever field in your database contains the dateline data
its kicking an error because you dont actually have a field called "timecolumn" It looks like your field is called dateline, so the sql is [sql] SELECT linkid,linkurl FROM adv_links ORDER by linkid ASC WHERE unix_timestamp() - dateline <= 3600*48 [/sql] |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|