Skip to content

Instantly share code, notes, and snippets.

@donnywals
Created February 1, 2013 11:09
Show Gist options
  • Save donnywals/4690708 to your computer and use it in GitHub Desktop.
Save donnywals/4690708 to your computer and use it in GitHub Desktop.
// Dit is fout, volgens mij.
$query = "UPDATE product SET (name, description, price, link, image) VALUES ('$_POST[name]', '$_POST[description]', '$_POST[price]', '$_POST[link]', '$product[image]') WHERE ID = '".$product['ID']."';";
// Zo doe ik het altijd:
$query = "
UPDATE product
SET
name = '".$_POST['name']."',
description = '".$_POST['description']."',
price = '".$_POST['price']."',
link = '".$_POST['link']."',
image = '".$target_path."'
WHERE
ID = '".$product['ID'].";
";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment