To update a new option name each time you need something unique to be used as option name so may be using ‘time’ in the option name
$now = new DateTime();
$mytime = $now->format('Y-m-d H:i:s'); // MySQL datetime format
// $now->getTimestamp(); // Unix Timestamp
$option['prefix-'.$mytime] = 'your value';
Then you can update as you wish.
To recall it will be a bit hard code. You have to get all value that start with prefix and manual parse the date time to get the newest one. This method is easy to create but a bit more step when using.
Hope it help
Related Posts:
- Will it break my site if I delete all transient records in wp_options table?
- Please explain how WordPress works with MySQL character set and collation at a low level
- What is the purpose of the option name hack_file in the options table?
- delete_option() and update_option() returning false
- How to change option recently_edited?
- store simple data in get_option()
- WP_Options ID high
- Transient RSS feeds in wp_options not removed automatically?
- Long option names fail silently?
- save new data to wp_options non-post form
- Huge wp_options table
- Cannot unserialize WordPress serialized values in `wp_options` table?
- WordPress DB: options-table –> 32 gzipcompression?
- wp_options table has duplicate rows and primary key / autoincrement has been removed
- Help running a MySQL query to update all wp_#_options tables in a Multisite install
- What ALL can cause “Another update is currently in progress.”? [closed]
- Should I remove transients from the wp_options table?
- I don’t see site_url and home_url fields in wp_options table (phpMyAdmin)?
- Accidentally deleted active_plugins portion of the wp_options DB table
- batch UPDATE autoload value in wp_options table
- Multiple wp_options tables to share content across installs
- Is there an atomic way to update_option in WordPress (to ensure data integrity)?
- Does auto_load to ‘no’ in wp_options improve performance
- Check if an option exists and get its value in one hit
- My options table is huge. What can I do?
- Change options table prefix only
- When to use custom DB tables or add_option?
- In which format the data is stored in WordPress Databases?
- Automate WordPress website setup with prefilled data
- Image link issues after importing a database backup to my local web server
- Native timestamp on wp_options option
- Whats the best practise on how to store json data from a custom settings page?
- WordPress Settings API Overrides My Previous Value
- What structure and database storage method should I use for temporary storage that may be written concurrently?
- get_option() does unserialize and don’t remove \
- I cannot change anything in my wordpress database from within wordpress?
- Wrong url for the images while using same database for two WordPress installations
- Options table – where does my values go?
- Theme options not being sent to Database
- Multiple Address In WP-Option Value
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Can I have multiple primary keys in a single table?
- get_results using wpdb
- How to create bulk page and content? [closed]
- Best way to move live site local
- The revisions table in my database is at 70% capacity and growing. What should I do?
- WordPress for a very large website
- wp_options table value
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- WP_list_table bulk_action get edit and delete
- How to display data from custom table in wordpress database?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- How to diagnose and keep in check encoding issues?
- Add search Value to wp_list_table pagination
- stdObject stored in database. How does one convert it to usable format?
- I have a table I created, how do I make a form for a user to filter the data?
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- Cannot update custom database table row
- Select two sums with single get_var statement
- Is there a smart way to obtain a list of only some selected user meta data?
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Permit Login if table row exists
- Make an Items attribute searchable (taxonomy using existing attribute)
- Store partial database to an archive database time to time
- Saving zero as meta value
- Migration: Copying database content to a different server
- How to convert srcset links from https to http?
- How to transfer from localHost to live but use the already existing database on the server?
- Connect a membership plugin to an external database
- Storing user’s data on external database on other server
- is it right choose to connect database in template page directly in WordPress site?
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Set a cron job to delete a specific database table table every midnight
- Two separate wordpress installations at one domain
- Is there a way to edit the WP content database in an admin panel or external page?
- SQL database import #1046 error
- Get all top categories, then only 3 posts for each
- Finding a page holding a specific string/URL that is used in the content
- next comment id number wordpress
- Migrate not successful, DB is broken. How to fix, or at least output static HTML without plugins?
- Backup Restore turns carriage returns to literal strings
- I have a WordPress 4.6 database dump – how do I use it in a new install?
- How to update the options table for a widget
- Find/ascertain latest wordpress db from multiple database copies
- Local Content different from Remote Content
- Check if a database is well installed
- WordPress + Postgresql
- Author ID mismatch from database
- MySQL Database User: Which Privileges are needed?
- Import Excel (or csv) Table with user-data as subscribers to wordpress
- Automatic add record after refreshing page
- SQL query : Select a thumbnail for a media
- WordPress: Interact with Database Query Data and Login
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- wp_usermeta key problem
- How to properly configure SSL connection to remote azure database for running queries within a WordPress environment
- Database Queries are crashing the server
- Uploading to WordPress Database