I want to start a php class file from server side.
Moderator: General Moderators
-
sankarsubramanian
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 23, 2006 1:18 am
I want to start a php class file from server side.
I want to start a php class file from server side which should delete records from the table which are one month older.
-
sankarsubramanian
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 23, 2006 1:18 am
is it possible
is it possible
Re: 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.sankarsubramanian wrote:is it possible
-
sankarsubramanian
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 23, 2006 1:18 am
if i write a function, how can it be called??
if i write a function, how and when will it be called??
-
sankarsubramanian
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 23, 2006 1:18 am
is it possible to call the function automatically??
is it possible to call the function automatically by any mean??
-
sankarsubramanian
- Forum Newbie
- Posts: 6
- Joined: Sat Dec 23, 2006 1:18 am
am new tp php
am new to php... please help meeeee
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')
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
This is not working code fyi, it's just an example of what you could do.
Code: Select all
<?php
$db = mysql_connect($host, $user, $pass);
$result = mysql_query('DELETE FROM table WHERE date < ' . $one_month_ago);
?>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
[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.