Skip to content

Instantly share code, notes, and snippets.

@kaspy003
Created August 4, 2016 12:21
Show Gist options
  • Save kaspy003/8c552082f0bf45894cea9500486f87a5 to your computer and use it in GitHub Desktop.
Save kaspy003/8c552082f0bf45894cea9500486f87a5 to your computer and use it in GitHub Desktop.
if(query("UPDATE `store_items` SET
".(!empty($cats) ? "`cats` = '".mysqli_real_escape_string(db(), $cats)."',":"")."
".(!empty($simular) ? "`simular_cats` = '".mysqli_real_escape_string(db(), $simular)."',":"")."
`date` = NOW()
WHERE `id` = '".(int) $post['id']."'
") && mysqli_affected_rows(db())){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment