So I have a form built in flash that runs this script when submitted. The only problem is the data doesn’t go through. When I go to the script in my browser, (asdfsd.com/script.php for instance) I get this.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, url, image) values ('', '', '', '', '')' at line 1
<?php
// create short variable names
$title=$_POST['title'];
$language=$_POST['language'];
$desc=$_POST['desc'];
$url=$_POST['url'];
$image=$_POST['image'];
$dbh=mysql_connect ("localhost", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("dbname");
$rs = @mysql_select_db( "dbname" )
or die ( mysql_error() ) ;
$sql ="insert into cms (title, language, desc, url, image) values ('$title', '$language', '$desc', '$url', '$image')";
mysql_query($sql) or die (mysql_error());
?>
I’m sort of a newbie to php so take it easy =p