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.





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 Complete Forum Thread with Replies

Related Forum Messages:
Delete Files From A Dir Older Than A Week
The below should delete files from a dir older than a week. I set the $dtime to 0 to test the script but it deletes nothing. What is wrong? Code:

View Replies !
How To: DELETE * FROM Table WHERE Greater Than 2 Week
I am building a module that displays the headline from a page that had the most hits last week. I was able to figure this out in PHP. I would now like to know how to delete and records that are over 2 weeks old. Anyone know how to do this in the mysql query?

View Replies !
Delete Entries 1 Week Old Or Older.
I have a query that's supposed to remove bulletin entries that are a week old and over, but its not working, and the "date" column is filled with "time();"

<?php mysql_query("DELETE FROM `bulletins` WHERE `date` > (time() + (3600*24*7))");?>

View Replies !
Week Beginning Count Records
i have a table with a large number of records, the two fields i'm interested in date (timestamp) and status, which can either be Pending, Rejected or Approved. when i display there records, is there a way in which i can display a count at the top of the screen.

but i only want to display the number of Pending, Rejected and Approved status's for the current week (Monday to Sunday). Obviously these numbers will change constantly during the day and start fresh every monday.

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 !
Sql Query For Count Records Of Current Week
I have a registration form that saves the registration date on a datetime column. I would like make a query to know how many records are in the table that where for the current week.

For example, I'm on week 25 and I want to know how many records I have for this week without the need of specifying the from and to dates. Is there a way to do this?

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 !
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 !
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 !
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 Replies !
Display For The Week Of (fridays Date Of The Week).
I have a report that people can access online and it generates data for a given week until friday. In the title and on the report, I want to display For The Week Of (fridays date of the week).

Instead of writing a huge if - then statement array - is it possible for to simply have an expression that figures out what day it is and then tells me Fridays date - has anyone ever done anything like this.

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

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

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

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 !
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:

View Replies !
Displaying Multiple Records And Want To Be Able To Update These Records With Different Values.
I am creating a page where I am displaying multiple records and want to be able to update these records with different values.

View Replies !
Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.

The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.

When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:

View Replies !
First Day Of A Week
hi,

i want to know the range of date for a week

example : week 3 of 2001

monday is ??
sunday is ??

how can i do with PHP ??

tx

View Replies !
Day Of Week ?
Is there a way I can obtain the day of week - If I have the day, month, year ?

(not via the time function - But from a database....)

Im looking through the calendar and date functions -But can't locate
anything suitable...

View Replies !
Day Of The Week?
is there a way to get the day of the week in php? i want to get the correct values monday, tuesday, wdenesday, etc. for the actual day it is.

View Replies !
Day Of The Week
I'm looking for some code who return the day of the week from a date. For instance : May 18th 2003 --> saturday .

View Replies !
Getting Day Of Week Out Of Datestamp
I currently have a datestamp in the format yyyymmdd. I want to pull the day of the week (Monday, Tuesday, etc...) out of that datestamp at any given time.

Currently my code looks like this:
$datearray = getdate($firstdatestamp);
echo $datearray["weekday"];
When $firstdatestamp = 20000501 (or the first of May, 2000) the weekday returned is Thursday when really it should be Monday!

I tried:
echo date("l", time());
and it gives me the right weekday but only for the current date. I need to pass this my datestamp and am not too sure how.

View Replies !
Getting Day Of The Week From A Date
I tried searching the old postings, but to no avail. I am trying to figure out a way to get the day of the week from a date. Basically, I have a date in the format of 05/02/2003 (but I can change that format easily) and I need to have my program figure out which day of the week that was. All of the dates that I have will have already passed.

View Replies !
Date Of The Week
Can anyone help me? I am trying to work out the timestamp for the first DATE (not day) of the current week and last date of the current week. Any ideas?

View Replies !
Date To Week # Fct
I'm searching a PHP function that would translate a date in the following
format yyyymmdd to the week number in the year...
ex : 20040128 => 5
i.e. jan 28th 2004 gives week nb 5 in 2004.

View Replies !
Week Of Year
Is there a function which returns the week of the year, given a specific date?

View Replies !
Getting SQL Rows For A Week
I have a database that uses two date fields for tracking information. The first field is for the addition of the record and the second is for the expiration.

I have a small section that I want to list records that will expire in the current week (or for that matter in the next 7 or 14 days). What is the syntax that I would use to call mySQL with to get that info.

View Replies !
Week Of The Month
I need to determine the week of the month (1-5) so I can rotate menus for a cafeteria.
Is the following, which I know prints the week rather than storing it, the simplest or easiest way to determine the week? PHP Code:

View Replies !
File Of The Week?
I wish to add an automated "file of the week" feature to a site for users to download.
I was having a little trouble explaining this.... So I ended up making these few points on the functions of the script I'm aiming for:

- The script finds the folder with the files for the current week. (If the download was a wallpaper, there would be files for different resolutions, and therefore more than one file.)

- Links are then made to the files.
- Every week, the links are updated for the new files for the current week.

I was thinking along the lines of putting the weekly files into folders named after timestamps and going from there... Is that the way to go? And how would it be done? I can't quite figure this out.

View Replies !
Printing Every Week
im trying to print a list of every Friday since a date defined. Let me try and explain. I want to define a date such as 2007-07-06 (which is a Friday) and then let php print each Friday since that date until today. For example, if the date defined was 2007-07-06 then it would print

2007-07-06
2007-07-13
2007-07-20
2007-07-27
2007-08-03
2007-09-14

But I want to also be able to format the date it outputs, so it might look like

Friday 06 July 2007
Friday 13 July 2007
Friday 20 July 2007
and so on.

View Replies !
Week Before Date
Im looking to get the date 7 days ago. I know how to do 7 days ahead:

$timeStamp = strtotime($oLastBatchDate->Last);
$timeStamp += 24 * 60 * 60 * 7;
$NextBatchDate = date("Y-m-d  H:i:s", $timeStamp);

However, does anyone know how to do 7 days back?

View Replies !
Date And Week
I am looking for a way to determine the week of the year if i have a date.i know that
date("W"); give me the week Number but not sure how to determine the week based on the date.

View Replies !
Day Of The Week Program
I am trying to write a program that will give me the day of the week without using the date function. I input the date and it's supposed to spit out the name of the day of the week. Here is what I have so far. I don't know quite what to do next. Code:

View Replies !
Get Dates Before From Last Week
<?php
//today date is: 2006-04-10 08:18:24
//last week is: 2006-04-03 06:23:10
$lastWeek=date('Y-m-d H:i:s', strtotime('-1 week'));
//How do I get any date before last week(2006-04-03 06:23:10)

//This show all date start from last week (2006-04-03 06:23:10) up to today (2006-04-10 08:18:24)
$result = mysql_query("SELECT * FROM $table WHERE dateCreate >= '$lastWeek'
//I want the opposite of this, from before last week, not from last week up to today.
?>

How can fixed the above code to get all dates in the database from before last week? Any idea?

View Replies !
Days Of Week
I'm attempting to display information for today, the next day and the day after (so only three days worth). The first day is hardcoded to say now. I want the next day and the day after to be the abbreviated day (ie. Tue, Wed and so on). The problem I have with the following code is that now and the next day are the same. Thus, I have now (which is Tue), the next day (which is ALSO Tues - wrong!) and the day after is Wed. Here's the include:

$return['mydata'] = array();
for($i = 0; $i < 2; $i++) {
$attr = explode('"', $this->tag('blm:mydata',$i));
if(count($attr) > 1) {
$day = array();
$day['when'] = $attr[1];
$day['image'] = IMAGES.$this->translate($attr[11]).'.gif'
array_push($return['mydata'], $day);
}
}
return $return;

And here's the front-end page:

echo " ".$stuff['mydata'][0]['when']."<br/>

View Replies !
Week To Date.
how i can make a week number to a date string. Ex. week 1 ---> 1 Jan. till 7 jan. Date format is not important.

View Replies !

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