How to update database
-
Hi everyone!
Now that I have made a good-looking options-page for my WordPress plugin, I have to send the information from my form to my database.
When I activate the plugin, it automaticly creates a new table, so that is done, in the table, there is a text from the beginning, I see the text on the dashboard (where I also have my plugin), now, I want to REPLACE that text, with the new text I write in the options-page.
Here is the code I’ve used so far:
<form method="post" action="options.php"> <?php wp_nonce_field('update-options'); ?> Edit your personal note below:<br> <textarea name="k_note" cols="70" rows="10"><?php echo get_option('new_option_name'); ?></textarea> <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="k_note" /><br><br> <input type="submit" class="button-primary" value="<?php _e('Save Note') ?>" /> </form>As far as i’m concerned, everything is looking fine (because i’ve read like a million articles about creating an options-page”.
Now, as I see, the form is senting the data to “options.php”, but in all the articles i have read, not one of them tells me what to type in THAT specific file.
So now, I ask YOU – does anyone in here know what I sould write in the “options.php”???
I’m really stuck here.. 🙁
Best Regards
Kucko
The topic ‘How to update database’ is closed to new replies.