Page 1 of 1

I want to start a php class file from server side.

Posted: Sat Dec 23, 2006 1:31 am
by sankarsubramanian
I want to start a php class file from server side which should delete records from the table which are one month older.

is it possible

Posted: Sat Dec 23, 2006 3:56 am
by sankarsubramanian
is it possible

Re: is it possible

Posted: Sat Dec 23, 2006 4:10 am
by Fractal
sankarsubramanian wrote:is it possible
Yes, but all you need to use is a function.. Most of the time there is no point to creating a class for 1 function.

if i write a function, how can it be called??

Posted: Sat Dec 23, 2006 4:20 am
by sankarsubramanian
if i write a function, how and when will it be called??

is it possible to call the function automatically??

Posted: Sat Dec 23, 2006 4:22 am
by sankarsubramanian
is it possible to call the function automatically by any mean??

am new tp php

Posted: Sat Dec 23, 2006 4:23 am
by sankarsubramanian
am new to php... please help meeeee

Posted: Sat Dec 23, 2006 4:57 am
by timvw
While you're waiting for an answer you might want to read viewtopic.php?t=8815. (And after that you might want to search the web for 'cron')

Posted: Sat Dec 23, 2006 5:25 am
by Luke
also, you could just set up a check for this any time somebody visits your page... so add something like this to the top of whatever page it is

Code: Select all

<?php
$db = mysql_connect($host, $user, $pass);
$result = mysql_query('DELETE FROM table WHERE date < ' . $one_month_ago);
?>
This is not working code fyi, it's just an example of what you could do.

Posted: Tue Dec 26, 2006 8:54 am
by feyd
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:4. All users of any level are restricted to bumping (as defined here) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.