rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit 9cec20cc002725f384db0bee63f3b6f9bf01e7bd
parent 87523c6f99077a44926c0f1cfccf51069da394e2
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sat, 16 May 2015 13:53:06 +0200

update sql

Diffstat:
Mcore/backend/blog/posts.php | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/core/backend/blog/posts.php b/core/backend/blog/posts.php @@ -170,11 +170,9 @@ function shortText($string,$lenght) { //$longtext = $post_text; function deletePost($id) { - if ($connection->query("DELETE FROM posts WHERE id=$id") === TRUE) { - echo "Record deleted successfully"; - } else { - echo "Error deleting record: " . $conn->error; - } + $stmt = $connection->prepare('DELETE FROM posts WHERE id=?'); + $stmt->bind_param('s',$id); + $stmt->execute(); $connection->close(); }