Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?


I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases.

Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Time Different Between My Apache Server And My Local Clock
I actually have two questions:

1. I try to get current time, but the time I got is 1 hour different from my
local time. I assume it is caused by Time Zone. So is there any easy way to
fix this? I assume that I can first get the Time Zone of the server by using
the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.

2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the
apache server clock (I don't own the server)?

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Auto Delete
This script was meant to delete a file after X days...in this case I wanted it to delete files that were older than 1 day except .htaccess. what the script is doing is deleting everything in the specified folders except htaccess even though the files are less than a day old. any suggestions? Code:

View Replies !
How To Auto Delete Table Row?
I Have A Page On My Site That The Database Outputs To. There Is A User That I Dont Want To Ban Yet , But I Do Want To Block Or auto Delete His Data. Now When Everyone Post New Data The Only Table That Would identify Them Is The Username Table, There Is No Member ID Table.

Now I Would Like To querry The Database And Auto Delete Table (Username) BOBBY And The Row BOBBY Posted , So There Is No Data Output To My Site Page For BOBBY. Can Someone Give Me A Couple Codes To Try, And I Would Think The Code Would Need To Be On A New Page That I Need To Make Up Right?

View Replies !
Add Records, Auto Generate..
we're doing a system for an accountant..we have records already for customers and each customer's should have many records and should auto generate every month..i have no idea about it, anyone here knows how to do it? i have an attachment here if you look into it, you will see a table at the bottom, what we have to do is to add another record on that table.

as you can see i already have a record, and next month another record should be added there, the payment cycle should automatically be aug1-31 2006, and so on..so every month, another record should automatically be added on that table. one more thing, how can i add a record to each customer if they only have one record. we have a database. it has fields

id, Lastname, firstname, bill, payment received, payment received date..etc

and of course each id/customer can only have one record. how can i add records to those firlds?

View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles.
To give the ID i simply use the Auto count of the DB.

But what happens when i delete a record? i am now missing an ID.
How can i insert a row and give it the first available number?

For example ID 1, 2, 4, 5, 6

i would Insert and set the ID number to 3.

View Replies !
Records Won't Delete
mysql_query("DELETE FROM guestbook WHERE id = '$recnum'"); It works fine on my local server but it doesn't delete records on the remote server. any ideas?

View Replies !
DELETE Records
I am going to write a php script to delete some records based on values supplies by the user. I was just wondering if the query is correct but there are no records to delete for example if this query was executed but there was no testId 7, would an error occur or would the query be performed but just not delete any records? PHP Code:

$testId = 7;
$q="$q="DELETE  FROM test WHERE testId = $testId";
mysql_query($q, $link_id)or die(mysql_error());

View Replies !
Wants To Delete Old Records
I want to delete records that are more than 7 days old($keeptime). I am new to this and can't figure out the correct code. The table is called 'x4tables' and the field 'tdate' is a timestamp. I have used: Code:

View Replies !
Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit  events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records.

I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head. 

I imagine in order to point me in the right direction you will need some information about my database.

View Replies !
Auto Delete Record/Send Email After X Hours
What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc.

I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script.

A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?

View Replies !
Delete Records Since A Week
I've been trying to delete records since a week and i'm not able to do it. Before with this script, i was doing so many things at a time and i was confused.But, now, i just displaying the records from a table N trying to delete them.Would somebody pls guide me.

I just wanna set the delete flag(i.e, i want to set the RBS_DELETE column to Y or something) when i check a check box to delete it. I've some 5 records displaying on my form and i want to check 3 of them and when i check them and hit submit, i want the RBS_DELETE column to have some value. PHP Code:

View Replies !
How Do You Delete Records From Mysql
Could someone please show me how to delete records from mysql. Maybe even an example in a loop that deletes records based on a criteria.

View Replies !
Delete Records From A Table
I have a table its called queue. It has a field called id. I want to delete all records in the table apart from the ones with id equals to 74 or 75 or 87. How do i do that?

View Replies !
Forms To Delete Records
I am trying to make a PHP script that displays all of the records from a database, then allows a user to edit or delete the records via a form. I need a checkbox beside the names and a text field with a number beside each name. Is there a way to make it delete all names with a check beside them and update all number that have been changed when the user clicks submit?

View Replies !
Delete Records From Table 1
I have a script that doesn't delete records from one database when it should, and now I have to do this myself because database is big and causes problems on the server. What I have is:

TABLE 1, field auction
TABLE 2, field id

so I would like to delete all records from TABLE 1 where the value of the field auction doesn't match the value of the field id in TABLE 2. Can someone help me on this, please? I need to get this database cleaned.

View Replies !
Delete Specific Records
On clients machine, currently to delete on trainee record it runs 10 queries to delete records from 10 tables. At the time of running all queries, server shows (104) Connection reset by peer. An error condition occurred while reading data from the network. I think it because of running 10 queries at a same time. Is there any possibility that through one line of query we can delete record from 10 tables. I've tried following query

DELETE FROM table1, table2, table3, table4, table5, table6, table7, table8, table9, table10 WHERE empID = 11;

But it gives ' error in query.

View Replies !
Delete All Records Starting In R
PHP Code:

$result2 = mysql_query ("DELETE FROM r_CompTables WHERE CompID = R??") or die("DELETE error: ".mysql_error());

I have this code but I want it to delete anything start in R. R will be followed with a number so it could be R5 or R91.

View Replies !
Delete Records Older Than 14 Days
Does anybody know how to make a script that automatically removes mySQL records older than 14 days?

View Replies !
Want To Delete The First Letter In A Column With 275 Records
table : product
column : code

in this column i have 279 records with bv. S1092734 i want to delete the first letter in all those records.

View Replies !
Delete Fixed Number Of Records
i have a table with one field. this field saves times as records. i want to there are 40 recoreds always. in other mean when inserts 41'st record then 1'st record be delete
how to delete fixed number of records at a time of first of my records asc (like select).
in other mean i want to like: delete from table order by time asc limit 0,1

View Replies !
Delete Selected Records From Table.
Can anyone see why this connection doesn't work? It's suppose to delete selected records from my table.

<?php

if (isset($_POST['delete'])) // && isset($_POST['delcus']))
{

foreach ($_POST['delcus'] as $val)
{
echo "$val";
$conn= mysql_connect( "localhost", "user", "password" );
$sql = mysql_select_db( "snow" );
$del = mysql_query("DELETE * FROM request WHERE qid =" .$val);
//$rows = mysql_num_rows($del);
$rs = mysql_query($conn, $sql, $del);
if($rs)
.........................

View Replies !
Multiple Delete From A List Of Records
If I have a list of records from a database on the screen, each with a check box beside them, how would I delete all the records that have been ticked? I assume I would use a variable similar to checked[], but not sure what syntax I would use to remove them from the database? Would I loop round each record comparing the checked[] value and it it's set, delete the record?

View Replies !
Do A DELETE Statement To Remove Any Records That Don`t Match.
I`m just trying to figure out the best method to delete my records and wondered if it was possible to do a DELETE statement to remove any records that don`t match. Here is my code so far:

$Query="select blah its huge:-)";
$RESULT=mysql_query($Query);
$my_rows=mysql_num_rows($RESULT);

for ($a=0; $a<$my_rows; $a++){
mysql_data_seek($RESULT, $a);
$Array = mysql_fetch_array($RESULT);
printf("%s<BR>", $Array['Email']);}

My Query returns Matched Records, what I would like to achieve is deletion of the records that didn`t match, would it be possible to do that under the printf statement. So delete all the records in the table that don`t match up to $Array['Email']??

View Replies !
Delete Option From My View Records Page
I have a list of things I need to do with my database - but this is my next hurdle - the delete query within my view records page. I want to be able to click on a button or link to delete a record in a table. I was envisaging that each record would have a delete button or link next to it and clicking that would remove it. Here is the script I have created to view "Devices": PHP Code:

View Replies !
Delete Records And Files In 1 Statement At Same Time?
How can i delete records and files in 1 statement at same time?

View Replies !
Delete Multiple Records In The Same Database Querie?
I have some code that deletes records from the database, in a loop. However its prety inificient as it makes a seperate database call in every loop whcih is slow. PHP Code:

for ($i=0; $i<count($idarray); $i++)
          db_query("delete from clicks where id='$idarray[$i]'");

Is their a more efficient way of doing that? It is posible to delete multiple records in the same database querie?

View Replies !
Database Delete Repeat Records And Add Up Totals
I have a database full of order records for our website. My goal is to delete people from the same 'address' field and add up the 'total' into one record. Can i get some example code on how this would be done?

View Replies !
Server To Server File Transefer Script, Getting Wrong File Size
Any help on this is most appreciated. I have created a function to download a file. It seems to work except the file sizes differ greatly. I start off downloading a 5mb .zip file and end up with a 2mb .zip file on the initiating host. Thanks for any advice on this.

function get_http_file ($host_url, $http_file)
{
global $host_url, $http_file;

$fp = fopen("$host_url/$http_file","rb");

while(!feof($fp))
{
$my_file .= fgets($fp, 4096);
}

$fptmp = fopen("/tmp/$http_file","wb");
fputs($fptmp,$my_file);

fclose($fp);
fclose($fptmp);

if (file_exists("/tmp/$http_file"))
{
$result_code = 1;
}
else
{
$result_code = 0;
}

return $result_code;

View Replies !
Automatic Delete From MySQL Database Table Expired Records?
I have a question . . .

how can i delete from MySQL database table automatic expired records ?
?

One think is to make a service that deleting the expired records . . .

Any other method ?



View Replies !
Database Server Auto-close
I just wondered if someone could clarify... I have a a script connecting
with mysql_connect and in an include at end of page mysql_close

If they script terminates before end of page ie. with an exit() or maybe
trigger_error(), does php always disconnect the open'ed connection?

I ask because PHP manual says yes, but I've seen some comments relating
to PHP 4 saying it doesn't.

View Replies !
CURL - Setting Up A Cron Job To Auto Transfer Things To Another Server
As I'm becoming more familiar with curl, I was wondering one thing. I like to transfer data via curl and will be setting up a cron job to auto transfer things to another server, as a backup. Are there any issues that would cause the transfer to slow down, or cause problems - IF - there's a lot of data to transfer?

I know this is a broad question, because I'm just looking for any possible hiccups when I initiate the curl statements. Hiccups that I may not know about, or understand. Anything that may involve timeouts, or the like. I don't expect any particular answer, but I'd like any thoughts that may help me keep my data flowing smoothly.

View Replies !
Delete Something On The Server Other Than Session_destroy?
i am able to build simple database system on my website when i happened to learn about the log-in system. I used php sessions on my website and it functioned completely but when i view it to another computer, even simple session page counter wouldn't work. when i copied the code(the page counter) to another php document webpage then opened it on my browser, it would work. Should i place a code on my pages that would delete something on the server other than session_destroy?

View Replies !
Can't Delete File From Server
I've pawed through previous posts and tried a bunch of the suggestions to delete files on my web server. I use Filezilla to UL stuff and lately the connection has broken a couple of times and I'm left with a couple of files that are named with complete jibberish. I can't chmod, rename, delete, etc. any of them. Code:

View Replies !
Delete A File In My Web Server
I have mysql database and a web page to upload files to my webpage, I know how to delete them from the database, but didnt find the code to delete them from the web server. Please help me with this code.

View Replies !
Admin Maintenance
I was already created the register page and login page, now im going to create admin page, and also i wanna to know the duties of admin.. i dont know what process is going to take in admin page.

View Replies !
Maintenance Page
I know to check a valu andif its say 0 using the die() function before the age loads to display a maintenance/offline page, how would I like..:
Code in the header/top of each page;
Code to change the online/maintenanc/offline status?

View Replies !
Mysql Maintenance
I have quiet some databases with a lot of operations (insert, update...) advise to make a daily optimisation of the tables. what about a repair in case of pb.

View Replies !
Session Maintenance
I'm trying to get a better feel for exactly how sessions work. At the beginning of a web page, I do either a session_start() or a session_register(...). When the user goes to the next page, I know the page needs to get the SSID.

I know I can send it as a cookie, hidden field, etc, but what other ways are available to send it? For example, I know that session_registering variables at the top of the second page works. If the user visits any pure html pages (extension html), how can I get the session back when they come back to my php pages. Without php on the page, how can I propagate the SSID?

View Replies !
Delete Files On Server Using Browser
I have several php files in a folder. I would like to have the possibility of deleting these files using my browser, rather than having to log onto the server and do that.

Reason? I am dealing with a slightly slippery client, in case he changes the password after i have put the entire site on it, i would like to be able to delete my files, in case i get stiffed on the payment.

Would appreciate any pseudo code/code on getting this done, if possible.

View Replies !
Delete A File That Is Located On A Server
I want to delete a file that is located on a server. The filename is in a Mysql database and now I have to put the line 'system("del c:apachehtdocsshopimg.gif");' somewhere in my code underneath. Any Idea how ? This line works already, but now the '.GIF' has to become a $file that equals the filename from the database...

View Replies !
Cron - How To Delete Sessions On Server
please help me to write a cron job which deletes all the session which are not
currently active.

View Replies !
Delete Temp File On Server
I am using the following to generate an xml doc to the users browser:

$fp = fopen("document.xml", 'w+');
$str = ($xml_frame->Fields('top_xml').$content->Fields('xml').$content->Fields('xml').$xml_frame->Fields('bottom_xml'));
fwrite($fp, $str);
fclose($fp);
header( 'Location: https://www.website.com/document.xml') ;

I would like to delete 'document.xml' after it has been loaded to the user's browser but unlinking the file kills it before it loads and sleep hangs everything. I there a way to detect when it's finished downloading to the user?

View Replies !
Can't Delete Pictures From Server After I Upload With PHP Script
I am using a php script to allow people to upload images, but if I go onto the server later, I am unable to delete or rename the images.

View Replies !
Making A Page Expire/delete Itself From The Server?
I'm a freelance web designer and I was wondering if I could put page on a clients server, and the page (or certain parts of the page) would automatically be deleted unless I did something?? (like maybe a php function or something). The reason I'm asking is because sometimes peeople I do work for leave me high and dry, don't pay me and just change their password to their server.

View Replies !
Delete Files From Server Based On Filename...
I need to open a folder on my server, then look at the files in the folder.... then if I find a file that meets a criteria - i want to delete it. for example, I have a file list such as

1_hello.jpg
1_boo.gif
2_raaaa.gif
4_mad.jpg
etc etc

The numbers at the beginning indicate the userid and an image they have uploaded... I need to open the folder, tell the script that anything starting with a "1_" should be deleted.

View Replies !
Script That Allows The User To Delete Images On The Server.
I have a script that allows the user to delete images on the server. The delete script has the server username and password in it as part of the code. This makes me nervous because if someone were to read this script, they would have access to the server and all the files Now on the server, I have .htaccess set to prevent directory browsing in the directory where the file is stored and the file the script is on is also password protected.

View Replies !
Help: Complex Search And Maintenance In MySQL
Constructing a multi-part database search in MySQL e.g. Part 1 delivers IDs 4, 5, 6; Part 2 delivers 12, 1, 34, 8; Part 3 delivers 25, 10, 2, 20, 15.

Want to display the results in a list IN THIS ORDER (i.e. 4, 5, 6, 12, 1, 34, etc.) and be able to display PAGE BY PAGE, e.g. 5 results at a time.

Search itself is quite long and involved , so would prefer not to completely re-do the search for every page.

I have tried the following:

1. Build up search in a temporary table: Holds the order for displaying results, but is lost immediately script terminates, hence cannot display page by page

2. Store ID nos in a string, then pull out and display 5 at a time: Able to maintain between pages in HTML_POST_VARS, but if send the list of IDs to MySQL, order appears to be lost

3. Works if do same as 2. but then retrieve data for IDs one by one. I am concerned this is going to take a long time if many users.

View Replies !
File Maintenance Script - Update Record
I am using a form to update a MYSQL file. There will be entries at the detail by person and date. I want to have the person enter the date and than display all the records entered for that date. I will then have 2 buttons to add or change. I am ok on displaying the selected records, I am ok with the add button. What I am unclear of is how to select the record to update from those displayed on the screen.

In non-browser langueages, I have used RRN with a hidden field to associate each line with the files RRN. Can someone give me some insight to do this with php?

View Replies !
Coding Suggestions For Easy Maintenance By Non-coders
I'm displaying product thumbnails with brief descriptions on web pages. Clicking
on the product does a javascript popup with larger image and detailed description info passed to the javascript functions from the table data. Code:

View Replies !
File Upload :: 'wrong File Type' On Another Server
doing a simple image (jpeg) upload to a directory. Have a script which works fine on one server but comes up with 'wrong file type' on another server. The server that works has php5 installed, the other is 4.2.2 but I am sure what I have should work on both.

PHP Code: ......

View Replies !
Clock
have you got a clock what is scripted in php and changes when time changes, just time not date.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved