I've done a simple PHP-thing which adds data into my mySQL database, using that "PHP $_POST" thing, now I want to do editing that data through PHP form again, but I don't know how to do that. I've tried once, but it failed.
Now, I wanted to do is if I add a "news" then, I'll be able to edit that, just like in blogs or news cms.
I'm just a newbie in PHP, so I don't know much yet in PHP and mySQL...
Code:
<?php
$author=$_POST['author'];
$date=$_POST['date'];
$shortstory=$_POST['story'];
mysql_connect ("dbserver", "user", "pass") or die ('Error: ' .mysql_error());
mysql_select_db ("dbname");
$query = "INSERT INTO blog (author, date, shortstory) VALUES ('".$author."', '".$date."', '".$shortstory."')";
mysql_query($query) or die ('Error updating database');
echo "Database Updated! <br />
Data Inserted : <br />
";
?>
I'm just a newbie in PHP, so I don't know much yet in PHP and mySQL...
Comment