Page 1 of 1

mySql - update a field in a table on condition on another fi

Posted: Wed Dec 06, 2006 7:49 pm
by stv
Hi there

why (in table: portfolio):

Code: Select all

$query = "UPDATE `portfolio` SET `showposition = showposition+1`  WHERE `published` NOT LIKE 0 AND `published` <= " . $timestamp . "ORDER BY id DESC";
doesn't work?

help!!!

Posted: Wed Dec 06, 2006 7:58 pm
by John Cartwright

Code: Select all

$query = "UPDATE `portfolio` SET `showposition` = `showposition`+1  WHERE `published` NOT LIKE 0 AND `published` <= " . $timestamp . "ORDER BY id DESC";
You had your backticks a little off

Posted: Wed Dec 06, 2006 8:07 pm
by stv
oh oh

thanks a lot jcart

(it's 3 am here...)