Hi,
I’ve searched this and other sites for a solution, but it doesn’t seem te help me out…
I’ve got this small CMS I’m working at, but the updating won’t work.
Here’s the update-code:
[php]
<? error_reporting(E_ALL); $link = mysql_connect("localhost","root",""); $db="promic"; if (! $link) die("Couldn't connect to MySQL"); mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error()); $title = $_POST['ud_title']; $subtitle = $_POST['ud_subtitle']; $body = $_POST['ud_body']; $show = $_POST['ud_show']; $id = $_POST['page']; if($show == "Ja") $show = "1"; if($show == "Nee") $show = "0"; $sql = "UPDATE articles SET title='$title', subtitle='$subtitle', body='$body', show='$show' WHERE article=$id"; $result = mysql_query($sql) or die(mysql_error()); mysql_close(); echo "Updated!"; ?>[/php]
The query is allright (or I must be missing something here…) but still I get this message:
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 ‘show=‘1’ WHERE article=0’ at line 1
I just don’t get, all variables have a value and the UPDATE-syntax seems allright.
Can someone help me out here?[/code]