Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $title = $_GET["article_title"];
- $cat = $_GET["article_cat"];
- $content = $_GET["article_content"];
- // Set database server access variables:
- $host = "localhost";
- $user = "root";
- $pass = "root";
- $db = "logansarchive";
- // Open connection
- $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
- // Select database
- mysql_select_db($db) or die ("Unable to select database!");
- $query = "UPDATE Articles ".
- "SET ArticleTitle = '".$title."', Category = '".$cat."', ArticleDate = '".date('Y-m-d H:i:s')."', ArticleContent = '".$content."' ".
- "WHERE ArticleTitle = '".$title."'";
- $result = mysql_query($query) or die ("Could not update the article:<br />".$mysql_error());
- header("Location: index.php?result=success");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement