How To delete a value in a mysql table after 1 hour
up vote
-1
down vote
favorite
firstly this is my edited Question. I've already asked this but my question was too unclear, so thats why i'm asking again.
On my site it stores the IP on the database with a if statment.
If the users ip is on the database
head to a error page.
else it access the site and it stores the IP.
But the point is I want the IP to be deleted after a hour in the database automatically. But thats what I couldnt figure out and didn't find a anser which fitted to my case.
I am on Windows OS.
I hope the description about my problem was clear enough, if it wasn't, ask ;D
I'm Glad about Help
php mysql database mysqli sql-delete
|
show 3 more comments
up vote
-1
down vote
favorite
firstly this is my edited Question. I've already asked this but my question was too unclear, so thats why i'm asking again.
On my site it stores the IP on the database with a if statment.
If the users ip is on the database
head to a error page.
else it access the site and it stores the IP.
But the point is I want the IP to be deleted after a hour in the database automatically. But thats what I couldnt figure out and didn't find a anser which fitted to my case.
I am on Windows OS.
I hope the description about my problem was clear enough, if it wasn't, ask ;D
I'm Glad about Help
php mysql database mysqli sql-delete
1
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12
|
show 3 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
firstly this is my edited Question. I've already asked this but my question was too unclear, so thats why i'm asking again.
On my site it stores the IP on the database with a if statment.
If the users ip is on the database
head to a error page.
else it access the site and it stores the IP.
But the point is I want the IP to be deleted after a hour in the database automatically. But thats what I couldnt figure out and didn't find a anser which fitted to my case.
I am on Windows OS.
I hope the description about my problem was clear enough, if it wasn't, ask ;D
I'm Glad about Help
php mysql database mysqli sql-delete
firstly this is my edited Question. I've already asked this but my question was too unclear, so thats why i'm asking again.
On my site it stores the IP on the database with a if statment.
If the users ip is on the database
head to a error page.
else it access the site and it stores the IP.
But the point is I want the IP to be deleted after a hour in the database automatically. But thats what I couldnt figure out and didn't find a anser which fitted to my case.
I am on Windows OS.
I hope the description about my problem was clear enough, if it wasn't, ask ;D
I'm Glad about Help
php mysql database mysqli sql-delete
php mysql database mysqli sql-delete
edited Nov 21 at 13:50
asked Nov 18 at 12:54
Predecitedq
113
113
1
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12
|
show 3 more comments
1
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12
1
1
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12
|
show 3 more comments
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53361084%2fhow-to-delete-a-value-in-a-mysql-table-after-1-hour%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53361084%2fhow-to-delete-a-value-in-a-mysql-table-after-1-hour%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I suggest you use cache lock instead of using mysql to lock an user out of the system. If you still want to use mysql. Cache lock such as redis. I recommends you use a schedule task to run a script to delete the IP record and release the lock.
– TriDiamond
Nov 18 at 13:01
Do you know how to create a scheduled task and run a script with it?
– Predecitedq
Nov 18 at 13:10
What hosting system are you using? If you are using Linux system, use crontab howtogeek.com/101288/…
– TriDiamond
Nov 18 at 13:42
And if im not using a Linux server?
– Predecitedq
Nov 18 at 14:08
You have to specify which hosting system you are using, enable me to further help you with your problem.
– TriDiamond
Nov 18 at 14:12