Update_option is a WordPress function that can easily pass information to the database.
Well, I think that when you want to put information in the database, We often want to pass in as an array.
How do you do this?
Please see the code below.
The point is to register "filename" as an array with "update_option" first.
There are various ways to do this, but one example is to complete this registration when the plugin is activated.
Method when plugin is activated
get_option is a function that pulls out registered information from the database.
It is assigning "filename" to $exist.
Next, use array_push to assign $exist by adding as an array.
Then, the array will be added to the database by using update_option again.
When you repeat this array_push, you can put more information on the array, and able to update by using update_option.
Here, $ _POST ['filename'] is a sample method, so please create with your own here.
(Also, $ _POST ['filename'] is not sanitized here.)
When you want to output the information from the database that is registered by array, use the normal "foreach" on the HTML side.
2019-07-25 Get information from the WordPress database using wpdb->prepare [plugin production] NEW!
2019-07-23 How to pass array to the database by using "update_option". WordPress Plugin Creation
2019-07-17 How to create a database table from a WordPress plugin
2019-07-13 Use current_time () when dealing with WordPress dates!
Go to top
2017 10/12 "Free download! WordPress theme "Minori"!
2017 07/12 "Free Jquery Fade in Fade out simple slider!!
2016 08/08 "Change the color for WordPress" page has been updated.
2016 05/03 Post your activity information !
3. Comming Soon
Copyright (C) Web Shakehands All rights reserved.