I am getting the following error when trying to run an UPDATE query: 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 'read='http://www The code I am using to UPDATE the query is: $pid = $HTTP_POST_VARS["pid"]; $company = $HTTP_POST_VARS["company"]; $title = $HTTP_POST_VARS["title"]; $version = $HTTP_POST_VARS["version"]; $pdate = $HTTP_POST_VARS["pdate"]; $website = $HTTP_POST_VARS["website"]; $email = $HTTP_POST_VARS["email"]; $cost = $HTTP_POST_VARS["cost"]; $ptype = $HTTP_POST_VARS["ptype"]; $os = $HTTP_POST_VARS["os"]; $ksize = $HTTP_POST_VARS["ksize"]; $maincategory = $HTTP_POST_VARS["main"]; $subcategory = $HTTP_POST_VARS["subcat"]; $requirements = $HTTP_POST_VARS["requirements"]; $keywords = $HTTP_POST_VARS["keywords"]; $shortdescription = $HTTP_POST_VARS["shortdescription"]; $longdescription = $HTTP_POST_VARS["longdescription"]; $limits = $HTTP_POST_VARS["limits"]; $homepage = $HTTP_POST_VARS["homepage"]; $icon = $HTTP_POST_VARS["icon"]; $screenshot = $HTTP_POST_VARS["screenshot"]; $reviewed = $HTTP_POST_VARS["reviewed"]; $ourrating = $HTTP_POST_VARS["ourrating"]; $read = $HTTP_POST_VARS["read"]; $padfile = $HTTP_POST_VARS["padfile"]; $download = $HTTP_POST_VARS["download"]; $featured = $HTTP_POST_VARS["featured"]; $mainfeatured = $HTTP_POST_VARS["mainfeatured"]; $catfeatured = $HTTP_POST_VARS["catfeatured"]; $subfeatured = $HTTP_POST_VARS["subfeatured"]; $link_id = mysql_connect("localhost",$userid,$userpassword) or die ("Error connecting to the database server."); mysql_select_db ($dbname); if (!mysql_query("UPDATE programs SET id='$pid', company='$company', title='$title', version='$version', pdate='$pdate', website='$website', email='$email', cost='$cost', ptype='$ptype', os='$os', ksize='$ksize', maincategory='$maincategory', subcategory='$subcategory', requirements='$requirements', shortdescription='$shortdescription', longdescription='$longdescription', limits='$limits', homepage='$homepage', icon='$icon', screenshot='$screenshot', padfile='$padfile', download='$download', reviewed='$reviewed', ourrating='$ourrating', read='$read', featured='$featured', mainfeatured='$mainfeatured', catfeatured='$catfeatured', subfeatured='$subfeatured' WHERE id = '$pid'", $link_id)) die(mysql_error()); PHP: The variable is being passed properly from the $HTTP_POST_VARS["read"]; and the table field name and type should be correct. If I remove the read='$read' from the UPDATE script it works properly and updates all other fields. Any ideas why it doesn't like this?
Are there any odd characters in that value? Any quotations or apostrophes? Post the URL of what you're trying to insert for that value and hopefully we can see from that if there's an issue. Ian
It will be different for each record but the one I am testing with is http://www.sharesoftdownload.com/blog/2006/02/11/post2blog/ Edit: I am using the same field type and inserting URL's with other values in the same query and they work fine!?