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);
- $date = date('Y-m-d H:i:s')
- $query = $dbh->prepare("UPDATE Articles ".
- "SET ArticleTitle = :title, Category = :cat, ArticleDate = :date, ArticleContent = :content ".
- "WHERE ArticleTitle = '".$title."'");
- $query->bindParam(':title', $title);
- $query->bindParam(':cat', $cat);
- $query->bindParam(':date', $date);
- $query->bindParam(':content', $content);
- $query->execute();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement