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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stv
Forum Newbie
Posts: 6
Joined: Thu Oct 19, 2006 8:29 am

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

Post 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!!!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
stv
Forum Newbie
Posts: 6
Joined: Thu Oct 19, 2006 8:29 am

Post by stv »

oh oh

thanks a lot jcart

(it's 3 am here...)
Post Reply