Jump to content

Mysql INSERT INTO


Guest kenwood
 Share

Recommended Posts

Guest kenwood

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...