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.





Time Limit To Delete From Mysql


on my site i allow users to upload .doc, .pdf and image files, over time these files will build up on the server and take up a bit of space, i was thinking of adding a "clean up" button in the admin section where files/users older than a certain time are deleted from mysql and the files (unlinked) can anyone advise me on the best way to acomplish this. i know i need to query the database then find all files uploaded (say after 28 days for example) is that on the right track or is there another way at all?




View Complete Forum Thread with Replies

Related Forum Messages:
Memory Limit Or Time Limit?
I have a script which takes user parameters and creates PDF catalogs that can't always finish. I think the bottleneck is a PHP or Apache configuration setting and ran some tests, but I don't know what to make of the results.

I started with the following settings and ran the same parameters each time:

Apache Timeout: 30
PHP max_execution_time: 30
PHP memory_limit: 8M

In each of 5 runs the script was cut short between 30 and 32s of execution time and used between .5MB and 6.5MB of memory. Code:

View Replies !
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ?

$query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt  WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error());
im just getting "Unknown table 'notes' in MULTI DELETE" ?

View Replies !
Time Limit Of A Redirect?
I'm using this Code: header("Location: page.php"); exit; to redirct the user but I don't want it to be right away.. I want a 4 second delay.

View Replies !
Limit For Execution Time ?
Is there any limit for script execution time in php.ini ??

View Replies !
File() Time Limit
Is there any way I can impose a time limit on the file() function, say if a
file doesn't open within a second I can skip opening it?

View Replies !
Time Limit On Exec()
I excute a bat file I create using exec() (using pdftk - exec() cannot
run it directly, so I create a bat file and use that.

Sometimes I get a time out when running large files.



View Replies !
How Would I Set A Cookie With No Time Limit?
I have a log in script which starts a session. I have to keep using this but I also want to have a feature were if a user ticks a box it saves a cookie on their computer for ever (until the "log out")

I've never used cookies.... how would I set a cookie with no time limit???

View Replies !
Cookie Time Limit
I've set a time limit of a week on my cookies, but if a user logs in on monday goes back on tuesday and it finds the cookie and has them logged in does this mean the 7 days starts again or do i need to write that in as a extra?

View Replies !
SESSION Time Limit
I'm looking for a recommended way to time limit sessions. I'd like to limit them both application wide and user. Would it be appropriate (secure/best practice) to use "session.gc_maxlifetime" and/or "session.cache_expire"?

View Replies !
Setting Time Limit On A Recrodset
I am fairly new to PHP and would like to know how I can set a time limit on a recrodset. I don't want to set the time limit globally. If there's an example I would appreciate it.

View Replies !
ODBC Query Time Limit
I'm trying to figure out a way to handle the possibility of an odbc query taking too long. If an odbc query takes longer than 20 seconds I want to trigger an error for my custom error handler to deal with. I haven't been able to figure out a way of triggering the error. max_execution_time (or set_time_limit) does not take into account the time that the script waits for an odbc query to return results.

max_input_time() doesn't work. It sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads. odbc_setoption() is supposed to be able to set the odbc query timeout but isn't recommended for production sites and it doesn't seem to work anyway. There doesn't seem to be any means of easily dealing with odbc queries taking longer than a specified number of seconds. Any other ideas?

View Replies !
How To Set Script Time Limit In Shell?
I am trying to set script timeout in shell, because there is zero time limit by default in shell and the script never times out.

I set set_time_limit(3); and also ini_set("max_execution_time", "3"); but nothing works. Is there any other way how to set max execution time or to set it properly?

View Replies !
Limit To Script Size Or Running Time??
I have been working on a script for a couple of days and I thought I had finally completed it but it seems to be stopping for no reason?  Is there a limit on the running time for a script or the size of the html page it can generate?

The script grabs the source from a webpage off thw web and extracts some data from the page and also a series of sub pages linked from it.   It takes all this data, checks whether it is already in my database and adds if it is not going to duplicate anything.  All of this bit works fine but it was the last bit that I have just completed which seems to be making the script stall half way through.

The data is listed over several pages with a next page link at the bottom.  The script checks to see if there is a next button and if so loops back through the script for the next page.  When I run the script with this addition, it stalls half way through the second page.

If I let the script run and comment out all the processing part of the script, it works fine and loops through all of the pages?

View Replies !
Limit A Database Field To Displaying Only One Time And Still Display All?
I have a data table with a field that contains the exact same text (example "some text") on several different rows. How can I display all my rows without getting duplicates of this field; I only want to display this field once. I tried to use a LIMIT, but this is not what I needed. Code:

View Replies !
Remote File Copy And Execution Time Limit
I'm trying to copy a file from remote server with copy(), but this usually exceeds 30 sec time limit and I get a fatal error. I'd like to know if there's any other way to solve this than increase time limit. Maybe it is possible to launch a separate thread for this process, so that script wouldn't wait for file being copied. Any suggestions?

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 !
How To Delete Session Automatically After Ther The Time Expires
In my page, for every user login, it will create a session
file for them with thier name itself in the default session folder, Now
i want to do is, If a person is use idle for 10 minutes, automatically
his respective session file should be deleted. How is should be, plz
tell me some idea or give some sample code

View Replies !
Sort Results By Date/time, Limit 5 Database Entries Of Today &/or Upcoming Days
I'm designing a website for my fraternity and in the database I have entries which contain past events, todays events, and upcoming events.  My problem is that I can not figure out how to sort the query results to display:
 
1) only past events based on the CURRENT DATE
2) only the events which fall on the CURRENT DATE or after, limiting the results to 5 entries
3) all events that fall on CURRENT DATE or afterwards

Example:   
Today is  September 15, 2007

Problem 1) Displaying all events that happened before September 15, 2007
Problem 2) Displaying only 5 results that fall on September 15, 2007 or after
Problem 3) Displaying all events that are happening on or after September 15, 2007

And obviously I would like the CURRENT DATE to change depending on what date it is, currently.

Ok so now I've been very redundant in my explanation of my problem here is the code and a link to what that particular page looks like. Code:

View Replies !
MySQL Limit Without Limit
This may sound confusing and unnecessary to some, but it is pretty much required for me to be able to make limit more flexible.

SELECT * FROM myTable LIMIT 0, 10 (gets first 10 records)

What I need is:
SELECT * FROM myTable LIMIT 0, ROWCOUNT (gets all records)

The problem is I'm trying to find what to put for ROWCOUNT without needing a second query to determine ROWCOUNT. I know I can just do SELECT * FROM myTable, but this will cause me to duplicate alot of data. Therefore, I really just want to know how to get ROWCOUNT.

View Replies !
Mysql LIMIT For All *but*...
I have a news script that displays the last five entries:

ORDER BY date
DESC LIMIT 0,5

No problems so far - but now I want to have a page that lets people view the archived news (essentially, all entries that aren't from the five most recent. I can say "LIMIT 5, 20" to get the next 20 entries - but what if I want *all* of the entries *but* those first five (or last five if I'm ordering by DESC)? The mysql manual doesn't seem to be much help on this one. I really want to say "LIMIT 5, ALL" but that isn't valid syntax, of course.

View Replies !
MySQL Connection Limit
Thought I read somewhere saying that there is a limit to how many
connections are available per mySQL account or something like that.

I wrote a PHP tool that uses a different PHP file whenever someone hit an
HTML form button (ie Submit). It turned out that each one of these PHP
files need to re-open the link to the mySQL database by the following
snippet or else that particular file won't work:

@ $link = mysql_connect("localhost", "myself", "");
if (!$link == 1)
echo "Connection to database failed.";

But I thought that PHP will use the already opened link from the previous
PHP file and as a result the above is not necessary. Is this true, or only
if it is within the same PHP file? And would having called the above code
snippet too many times cause mySQL to prevent user "myself" from connecting
again?

View Replies !
Limit Mysql Results
I have a script which has a mysql query which returns 20 results - I want to add some validation so if my variable ($var) is empty, it only allows the user to select the first 5 results my code is: -

$sql = mysql_query("SELECT * FROM greetingcards_cards WHERE category='$cat' LIMIT $from, $max_results");
while($row = mysql_fetch_array($sql)){   
        $image = $row['url'];
       $cardid = $row['cardid'];
        echo "<br><img src="$image" /><br><a href="?function=sendmessage&cardid=$cardid">Pick this card</a><br>";}

I want it so that if the variable is empty, instead of displaying "Pick this card" it displays - "You must register to pick this card" and have a different hyperlink Is this type of validation possible? if so how is it done?

View Replies !
PHP/MySQL Process CPU Limit
i am developing a PHP5/MySQL website and testing it on my local machine, on an Apache server. And I have a problem.

I have written a PHP script that does a lot of computing and MySQL queries. I start it from a link on one of the pages on the site and when it's complete, and when it's done it writes in the output a sort of a "OK, DONE" statement on the next page.

This script has a lot of loops and can take up to 15 minutes to complete. The problem is that, while it is running, it takes up all of my CPU power, and I can't browse/do other stuff on the site until it's over.

Is there any way that I can limit the amount of CPU available to a single script???

View Replies !
Mysql LIMIT Syntax
php manual doesn't have anything for mysql_query syntax neither does the SQL manual, they only talk about sql code ONLY, no php i want to do this:

$rownum = 3;
$query = mysql_query("SELECT * FROM table ORDER BY datetime_modified DESC LIMIT $rownum, $rownum");

this is not the correct syntax: LIMIT $rownum, $rownum
neither is this: LIMIT '$rownum', '$rownum'

what is?

View Replies !
Does Mysql Join First Or Limit First?
SELECT ...
FROM table1
LEFT JOIN table2 ON table2.key2=table1.key_part2
WHERE table1.key_part1=<constant>
ORDER BY table1.key_part2
LIMIT 100,100

both WHERE and LIMIT don't refer to table2

steps:
1. use "where" condition to search(i meant via key) on table1
2. join table2 using "ON ***" to get result
3. stop as soon as 100 rows found

does mysql do join first(123) or do limit first(132)?

View Replies !
Limit Mysql Output By Letter
At present I have 26 tables 1 table for each letter like drinksa, drinkb, drinkc..ect which represent a, b, c...ect

I have realised this methed it not good practice as I can't search all 26 tables in one go.

What I would like to do now is put all the drink a to z in one table called drinks.

I would then be able to search that 1 table, this is fine I can do that without a problem.

But I am haing some difficulty getting my head around the front end what I mean is on the front end of the site on the drinks page there are links to each section like a, b ,c, d, e,......x, y, z.

But if all the data is in one table then all the drinks a to z would be output I know I can limit how many to output but I was wondering is it possible to limit by starting letter

For example when a user clicks "A" then all the drink starting with "A" are output but not any other drinks starting with a diffrent letter.

This would be done by usin an sql statment I belive by using limit but am not sure if its possble to limit by letter.

View Replies !
Limit Characters From Mysql Select
I am trying to limit the characters from a mysql query. I want to limit the characters displayed to say the first 100 characters then I can add a read more button where they will be sent to another page for the full text. Code:

View Replies !
Mysql LIMIT Clause For Arrays
I am trying to implement pagination for my news script ran on flat text files, and i can't get the 'core' idea to work - to display particular items from an array (For example display all items from 10 to 20, from 0 to 10, from 1000 to 2000 - you get the idea).

This is where i got one more mysql advantage - you can use a very handy LIMIT clause there. So how do i "emulate" it with arrays? It's got to be very simple, but i suck at programming. I tried array_slice($array, 10, 10) ; array_slice($array, 10, 20) and same for array_splice. Code:

View Replies !
Setting A Maximum Limit On A Php/mysql Result?
I am using PHP and MySQL to do this script. I want to have a table that contains only numbers for data and then add them all up as a result to display and that I have accomplished with no problem and then I want to display a percentage of that number to the public however that also I have accomplished with no problem using round()...

The problem is I am trying to set a maximum number that it displays.

I want it to display 1-500 no matter what the number is or the decimal it may have is provided it doesnt exceed 500 but once it does I want it to display 500 as the limit so even if it is say 674 I want it to only display 500. How would I go about doing this?

The sql I am using for the adding is SELECT SUM which works just fine and I am using round( $total_number *.15, 2) to display the percentage number of 15%.

View Replies !
Mysql DELETE
im a stuck again, could some one please tell me why this dosent work;

mysql_query("DELETE FROM messages WHERE from='$fromid', sento='$myid'");

View Replies !
Delete For MySQL
I'm an experienced java/C++/SQL programmer who hasnt used PHP. I'm looking for some generic database access pages for doing dds, edits, deletes, etc., hopefully with some error handling. I'd rather start with a basic shell of code, so I don't have to reinvent the wheel, and can just change connection string, database fields, etc.

View Replies !
Cookies Set One Time, I Delete Cookie, Cookie Is Never Set Again!
I am having this problem: My PHP script will set a cookie, it's there in my
/Cookies folder. I delete the cookie (I have to for testing purposes, the
PHP script I run behaves according to this cookie existing or not) and run
the script again. Everything runs fine, but the cookie is never set again.

Does anyone know why this happens? I am using Win2000 Professional with IE
6. Cookies are being set with PHP and Javascript.

View Replies !
Delete MySql Row By Date
Can someone help me with the following problem:

I have a table that includes a column for "last application date", let's simply call it "date".

Now the problem is how to automatically delete rows where the information in the "date" column has gone old, let's say by -86400 (1 day).

Example: today's date is April 11th, which means that all rows with the info April 10th in the date column would get deleted.

View Replies !
How Do You Do A CASCADE Delete In MySQL?
I'd like to delete a record and all its children records at one time. How
do I do that?

Can you, in one SQL statement,

delete from table 1 where id = 3
delete from table 2 where id = 12
delete from table 3 where id = 12
......

View Replies !
MySQL - Delete Across Two Tables. OT
i cant find the MySQL newsgroup, however i am
hoping to pick up on some expert advice from php/mysql gurus here. I'm
having some trouble performing a delete across two tables.

The tables i have are:

questionnaires (id, name);

questionnaire_questions (questionnaires_id, id, name, qf_type)

The questionnaire_questions table contains a list of questions for a
specific questionnaire (indicated by the questonnaires_id). I would
like to remove a questionnaire, and when doing so all corresponding
questionnaire_questions who have matching id's (questionnaires.id =
questionnaire_questions.questionnaires_id).

I have this statement, however it only works if a questionnaire has
questions... however i would like it to delete even if no questions
exist for that specific questionnaire. The SQL i am using is:

delete questionnaires, questionnaire_questions FROM questionnaires,
questionnaire_questions WHERE questionnaires.id =
questionnaire_questions.questionnaires_id AND questionnaires.id =
THE_QUESTIONAIRE_TO_DELETE_ID

View Replies !
DELETE Problem With MySQL
I've been learning using PHP and MySQL from the tutorial at
freewebmasterhelp.com. Everything works fine, except deleting things.
The script is invoked with a URL like this:

http://www.example.org/test/delete_entry.php?id=35

And here's the script:

<?
include("dbinfo.inc.php");

$id = $_POST['id'];
mysql_connect($server, $user, $password);
$query = "DELETE FROM test1 WHERE id = '$id'";
@mysql_select_db($database) or die("Unable to select database.");
mysql_query($query);
mysql_close();

header("Location: entries.php");
?>

The dbinfo.inc.php file defines the variables $server, $database, $user
and $password. The login part works.

View Replies !
Mysql Delete From A Form
i'm trying to find out how to get this to work. You type in a name of a record in the database and it removes it. In this case it's deleting the record that when you type in the name of the server it looks for it in the column "servername". You type in the servername and it will delete the whole record. Code:

View Replies !
MySQL MultiTable Delete...
I've been able to delete rows from one table successfully but what I want to try next is giving me some problems. I have a users 'id' which is unique. Heres what I want to-do.

DELETE * FROM users WHERE id = 1
DELETE * FROM messages WHERE from = 1
DELETE * FROM comments WHERE user = 1

In each table there oginizaed a little different hense the id , from & user... but thats what I want to-do, without having to-do them all sepreatly, would like it to be efficent. the users ID will be passed along as the var 'id' any thoughts? So pretty much it takes the users id number and deletes them from each table.

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 !
Mysql Delete Record
when I run this code below it doesn't delete the record or display any error message

$id = $_GET['id'];
include("../dbconnect.php");
mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error());

Such a simple thing to do but I don't no why it doesn't work 

View Replies !
How To Delete Only Certain Text In A Mysql Row?
I have a table setup that has a column setup as friends and users can add friends to this column no problem.

What I would like to know is how to delete only certain parts of the text of the row/cell where their friends are stored.

The friends text is seperated by the following :

" , "

That is a space on either side and comma in the middle of the space.

I know how to explode the results and put into an array to display the reuslts, but is there a way to delete only one of the friends if the text is as follows.

 , thomas , frank , irene ,

I think you can get the idea.

Is it possible to do this or should I just update the whole cell without the array[$i] result being the friend?

View Replies !
How Do I Delete A Full Row In Mysql ?
how do i delete a full row in mysql ?

View Replies !
PHP Unlink() & Mysql Delete
Im trying to delete a file, then delete the row in my table that holds the info for this file. I tried the code below and got this error:

Parse error: parse error, unexpected T_STRING in /nfs/cust/4/97/13/731794/web/Admin/backup/PXS_DeleteBackup.php on line 34


Here is my code:

View Replies !
Mysql Row And File Delete
I have a database with the following colums, imageID, imageName, imageDesc, imageFile, imageHeight, imageWidth, imageThumb, imageThumbHeight, and imageThumb Width. I can easily delete a row from the mysql table, galImages, but I also want to delete two files from a directory. The file names are stored in the columns imageFile and imageThumb.

View Replies !
Delete MySQL Data
I am building a lunch ordering system for a company. The employees can login, order lunch, and the administrator can see what everyone ordered for lunch in the admin panel. The problem is that when the employees enter data, it stays in the database until they update it. If an employee is sick, their lunch order from the previous day is still in the database. Is there a way to clear those values they enter at a certain time in MySQL.

View Replies !
Mysql Query : Delete From *
When I use phpmyadmin, and run this sql query, it will tell me that it affected X amount of rows (lets say 10). However, when i run my script, it doesnt' tell me that. Code:

View Replies !
Delete Duplicates In MySQL
I have a database in MySql which has 2 fields. The 1st field is called id which is the primary key. The 2nd field is called full_add where there are some duplicates.

I would like to delete all the duplicates in the full_add field leaving only 1 record behind.

It does not matter if the corresponding primary key gets deleted as well because the primary key is not related to any other table or database. I prefer not to use temporary tables or create new tables because my webhost does not allocate much memory to me & my database is quite big.

View Replies !
How To Delete MySQL Database.
I've got three hostings with the GoDaddy hosting service. The hostings are supposed to provide only one MySQL database each. I've just recently noticed in the phpMyAdmin program that separate databases, each with the name "test," has appeared in two of the three hostings.

I don't know how they got there. I didn't put them there. I contacted GoDaddy's technical support. They said that the "test" databases automatically comes with the phpMyAdmin program. Of course, that's not right. Anyway they said that I could delete the extra database without damaging anything.

View Replies !
MYSQL/PHP Delete Script
Im having problems getting my delete script to work it comes back with: Delete Error: Unknown column 'EVANS' in 'where clause' so it is using the surname i input as the column name but why?

View Replies !
Does MySQL Start To Reach Any Sort Of Limit In The Number Of Rows
Does anyone thinks it's better to use one table for a lot of information, or use multiple tables to separate the info. For example, I am going to be having different areas from all of the western states reporting recruiting activity each week. If there are five regions reporting in each week, and about 10 people in each region reporting, would you recommend just having all the info in one table seprated by a regional name, or have a separate table for each region? My main question is: Does MySQL start to reach any sort of limit in the number of rows in a table that it can effectively process? If there were, say, 4,000 rows in a table, does that become a problem?

View Replies !
Displaying Last Result From A Mysql Table With A Limit Of 10 Results Per Page
I want to show the last post in a mysql table. And i am displaying them with a limit of 10, i.e. 10 results per page. Now i have a problem figuring it out what would be the starting point of the results display in this case. Code:

View Replies !
Mark A Row In My Mysql Database As To Be Delete
Is there a way in php that I can mark a row in my mysql database and then later so delete these rows that have been marked?

View Replies !

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