Jump to content

Recommended Posts

That doesn't sound correct.

 

I am trying to make a last viewed items list, that will display your IP's last 10 viewed items. Once the 11th item is added, the oldest item of the ten items is removed, and the second oldest item takes its place, and the 11th item now becomes the 10th item.

 

Yours sounds like it will only allow 1 item then remove it. Yes I am using MySQL (thats why its in the MySQL board).

Link to comment
https://forums.phpfreaks.com/topic/39890-delete-from-table/#findComment-193033
Share on other sites

Why worry about deleting anything past the last 10 IPs?

 

You can keep them all and use something like this to view only the 10 newest:

SELECT * FROM ip_list ORDER BY ip_id DESC LIMIT 10

At least that way if you do need to check for duplicate IPs or anything else then the data is there, it's just that its not being used.

Link to comment
https://forums.phpfreaks.com/topic/39890-delete-from-table/#findComment-193243
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.