balkan7 Posted March 4, 2008 Share Posted March 4, 2008 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 banner_id = 30' at line 2 code: $banner_expire_choice = isNum($_POST['banner_expire_choice']) ? $_POST['banner_expire_choice'] : "1"; $expire = "NOW() + INTERVAL ".$banner_expire_choice." WEEK"; $bquery = "banner_url = '$banner_url', banner_img = '$banner_data'"; if ($banner_expire == "") { $update_banner = dbquery("UPDATE ".$db_prefix."banners SET banner_type = '$banner_type', banner_status = '$banner_status', banner_plan_id = '$banner_plans', client_id = '$client_id', banner_name = '$banner_name', ".$bquery." WHERE banner_id = ".$banner_id); echo "<center>".$locale['M_058']."</center><br /><br />"; } else { $update_banner = dbquery("UPDATE ".$db_prefix."banners SET banner_type = '$banner_type', banner_status = '$banner_status', banner_plan_id = '$banner_plans', client_id = '$client_id', banner_name = '$banner_name', banner_end = ".$expire.", ".$bquery." WHERE banner_id = ".$banner_id); echo "<center>".$locale['M_058']."</center><br /><br />"; } Link to comment https://forums.phpfreaks.com/topic/94372-sql-syntax-help/ Share on other sites More sharing options...
fenway Posted March 5, 2008 Share Posted March 5, 2008 Echo the string you're passing to dbquery(). Link to comment https://forums.phpfreaks.com/topic/94372-sql-syntax-help/#findComment-483532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.