Guest kenwood Posted December 17, 2005 Share Posted December 17, 2005 Hey i tried everything, and it works on my local apache host server, just not on my own website. I'm making a website that needs to INSERT text into a database, but it doesn't seem to like this code:if(isset($_POST['save']));{ $title = $_POST['title']; $content = $_POST['content']; $picture = $_POST['picture']; $query = "INSERT INTO homepage (title, content, picture)". "VALUE ('$title', '$content', '$picture')"; $result = mysql_query($query) or die('Error ,query failed'); echo "Article '$title' Added"; echo "<br /><a href='index.php'>Back to Homepage</a>";}Error ,query failedI still have no idea, for starters it shouldnt even be reading this right away as the form comes first in the coding because the parameter save is not met firstPlease HELP! haha im so frustrated!! Link to comment Share on other sites More sharing options...
lavarock09 Posted December 19, 2005 Share Posted December 19, 2005 if(isset($_POST['save']));{ $title = $_POST['title']; $content = $_POST['content']; $picture = $_POST['picture']; $query = "INSERT INTO homepage (title, content, picture)". "VALUES ('$title', '$content', '$picture')"; $result = mysql_query($query) or die('Error ,query failed'); echo "Article '$title' Added"; echo "<br /><a href='index.php'>Back to Homepage</a>";} I changed VALUE to VALUESThat should work Link to comment Share on other sites More sharing options...
aspnetguy Posted December 19, 2005 Share Posted December 19, 2005 yes if the typo was the problem that should fix it. If not you should ensure that permissions are set correctly on your website. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now