Re: Automatically changing data in database
| From: | Siim Einfeldt | Date: | Thu, 24 Aug 2000 14:48:08 +0000 |
| Subject: | Re: Automatically changing data in database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13430@lists.php.net to get a copy of this message | ||
> OK, so at 24h00, all articles with the value 'yes' in the 'today' column
> must
> change to 'no' right?
> Unless you have compiled the CGI version of php (--without-apache), I would
> write a perl script that's executed by a cron job at 24h00.
> I can help with the cron job, but I forget how to do db stuff in perl.
> If you have installed the version of PHP that can execute from the command line,
> then this should be no problem for you.
Hmm...I will check it out whether I can or not execute it from the
command line (it`s not my server, just started using it). But you can
still give me the notes as the magazine most likely won`t stay on that
server for very long and the new one will hopefully have all needed
things enabled..
I don`t know anything about cgi, perl, so any help you can provide with
cron job, is appreciated....or you could just teach me this thing a bit,
but I suppose that would be a lot bigger job.
> Would it not be simple enough to add another column for the date
> eg: ALTER TABLE articles ADD COLUMN article_date date
> and store the date at the same time the article is added. In this way, your
> script can search the db for articles that are dated today and then only display
> those.
I already have a date column in my database. The case is that only one
of the 'yes' articles will be shown fully(and that`s the problem
child...). And...I don`t know how many articles will be written in one day
or....right now it will be a 'made for you by you' basis magazine. So one
day there might come 10 articles (but only one will be shown fully on the
front page), but another day none. So that`s the reason why I think it
would be the best to show the articles according to it`s position in the
queue.
-------------
Siim EInfeldt