Hello, I'm autodidact and begginer in programing. So I created a file to try to edit and delete my posts but I have no idea what is wrong with my code.
The code is:
PHP Code:
<?php
include('connect.php');
if (isset($_POST['delete'])) {
$apagar=mysql_query("DELETE FROM editor WHERE id=$id");
$rows=mysql_fetch_assoc($apagar);
echo "Text updated";
}
if (isset($_POST['update'])) {
mysql_query("UPDATE editor SET message = '$_POST[message]' WHERE id = '$_POST[id]'");
echo "Text updated";
}else{echo 'Text updated';}
?>
Waiting for your help, thanks.
Bookmarks