Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $title = $_POST["article_title"];
- $cat = $_POST["article_cat"];
- $content = $_POST["article_content"];
- // Set database server access variables:
- $host = "localhost";
- $user = "root";
- $pass = "root";
- $db = "logansarchive";
- // Open connection
- $dbh = new PDO('mysql:host='.$host.'dbname='.$db., $user, $pass);
- $dbh->beginTransaction();
- $query = "UPDATE Articles ".
- "SET ArticleTitle = '".$title."', Category = '".$cat."', ArticleDate = '".date('Y-m-d H:i:s')."', ArticleContent = '".$content."' ".
- "WHERE ArticleTitle = '".$title."'";
- $dbh->exec($query);
- header("Location: index.php?result=success");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement