View Single Post
Old 08-09-2008, 12:20 PM   #1 (permalink)
codefreek
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Help Syntax error here why?..

PHP Code:
function approve($items) {
$cat mysql_real_escape_string($_POST['category']);
   
$ids implode(",",$items);
    
$sql "UPDATE news
        SET valid = 1 AND cat_id = 
$cat
        WHERE id IN ("
.$ids.")";
mysql_query($sql) or die(mysql_error());


Syntax error:
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 'WHERE id IN (6)' at line 3
codefreek is offline  
Reply With Quote