LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-18-2004, 08:07 PM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
a Simple help on PHP Script


Hi Guys. I would like some help on a script that execute a mysql query, checking if the current time is not equal at the time saved on the database. I mean if the time saved on the DB = 2004-10-18 17:09:31 and the current time = 1 hour after or more execute the mysql query.

I had done this:

PHP Code:
$timestamp time();
$datum date("Y-m-d H:i:s",$timestamp);
$todaysDate =date("H:i:s");
$count 3600// 1 hour
$temp =$todaysDate $count;
if (
$temp){

mysql_query("DELETE FROM psc_sessions WHERE date<>'$datum'",$conexion);

Thanks in advance
 
Old 10-18-2004, 08:26 PM   #2
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks... I got it with DELETE FROM psc_sessions WHERE date <= DATE_SUB(NOW(), INTERVAL 1 HOURS)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Simple PHP Script benrose111488 Programming 7 01-31-2005 01:39 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
Simple php script with html form not working. sinsoush Programming 4 04-01-2004 08:02 PM
Simple C Shell script is not so simple elconde Programming 2 09-16-2001 11:53 PM


All times are GMT -5. The time now is 11:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration