Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:36:04+00:00 2026-06-11T23:36:04+00:00

I try to delete a row in my DDB in 1 week. I wrote:

  • 0

I try to delete a row in my DDB in 1 week.

I wrote:

<?php
//in my page
//On click
$today=date("Ymd");
$query = 'INSERT INTO mytable VALUES (id,val,date),("", "'.$val.'", "'.$today'")';
dbb_exe($query);
?>

<?php
//in my header
//Check my table
$today=date("Ymd");

$query = 'SELECT date FROM mytable WHERE id=.'(int)$_GET['id'];
$r_date = dbb_exe($query);

//Here it's where i want delete my row if the row exists since 1 week

if($r_date==($today - "1week")){
//DELETE row
$query = 'DELETE FROM mytable WHERE id=.'(int)$_GET['id];
dbb_exe($query);
}


?>

As you see i don t know how to calcul the var “1week”,

right now i m reading strtotime to try something like $date= strtotime($today);
but i m lost , anyyway i have all the day(+night) to success

Red bull and stackoverflow are my friends.

Thanks to the community

Have a nice day

Mel

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:36:05+00:00Added an answer on June 11, 2026 at 11:36 pm

    Instead of doing all work with php, I believe you can try something like:

    DELETE FROM mytable WHERE date = DATE_SUB(CURDATE(), INTERVAL 7 DAY)
    

    This should delete all records from mytable with date equals to the 1 week ago.

    Replace = to < if you want to delete all records older than 1 week.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to delete a row from my iphone app,I could correctly fetch
How delete row from table with help jackcess? I try so, but it's bad:
I try to delete a row from my table, but when I try I
I get the following error while I try to delete a row while looping
friends, i am trying to delete row and then when i try to fetch
I simply try to delete a row from a UITableView with the following code:
I am getting ArrayIndexOutOfBoundsException when i try to delete a row from a listView
I try to delete a record in Gridview and Database .I added a boundfield
when i try to delete the entity Visual Studio keeps crashing on the line
I am using the following code to try and delete entire rows when it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.