• Hello i need to create a form to save/edit data in a table in an external database.
    I would like to know if it’s possible to use wp_editor and save the value in the databse ? Or if i have to found a other way to have tinymce editor

Viewing 3 replies - 1 through 3 (of 3 total)
  • On the front end or back end? By external database do you mean a database on a different server? An external API? A different database on the same server? Or just a different table in the WordPress database?

    Thread Starter sbuerman

    (@sbuerman)

    Hello, thanks for you answer.
    the both front-end and back-end. I mean a database on different server and it’s a sql server database

    Moderator bcworkz

    (@bcworkz)

    Sure, it’s possible.

    The editor outputs a textarea form field not all that different than any other textarea. What’s important is the form element that it occurs in and what code processes that from data when it’s submitted. It’s the same process as with any HTML form utilized through PHP.

    You can use mysqli functions to connect to the DB and write data to it like you would with any SQL database. Alternately, you can use the wpdb class to instantiate your own DB connection object just like the global $wpdb object. Then you can use all the wpdb methods to interact with the DB just like one would do with the WP database, except it’s connected to a different database.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Save wp-editor value in a external database’ is closed to new replies.