Jump to content

I need to delete a piece of data when a new piece of data is entered


greenace92

Recommended Posts

Hello,

 

I'm working on a project that requires me to have stock / fake demo files that will be replaced with real files provided by users... I need something to take space and then when people actually start using the site and inputting data, then I can replace each file with new, unique files.

 

I have some idea of how this would work.

I would need incremented or non-matching identifiers and then a script that probably works on an if statement 

 

like

 

If new data, take first list of data, delete, replace with new data. Something like that. 

Link to comment
Share on other sites

I'd do it a bit differently, and not store fake data in the db.

 

Lets say you have a "documents" page, and you are displaying 20 items on it. So you query the database to get the "documents" and let's say only 5 exist. In your view, I'd just check the quantity of results that you got back from the db and subtract it from 20, which would be 15. So display the 5 existing "documents" and then generate 15 "placeholders" just using HTML/CSS.

Link to comment
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.