I'm creating a simple website with just two or three pages, and I'm using Froala editor to edit the content directly from the page. So I have a <textarea>
within a form with the id of "edit" (To make it a wysiwyg editor) and a submit button. So basically what I want it to do is to UPDATE the "body" column in the table "pages" (where the type = 1) in my database when the button is submitted... Here's the code I have:
<?php
$query = "SELECT * FROM pages WHERE type = 1";
$result = mysqli_query($dbc, $query);
$page = mysqli_fetch_assoc($result);
?>
And the html:
<form>
<textarea id="edit" name="body"><?php echo $page["body"]; ?></textarea>
<button type="submit" class="button button-primary">Save</button>
</form>
Aucun commentaire:
Enregistrer un commentaire