Basic MySQL command question

Hello,

The site's been migrated from 5.6 to 6.1.4 and there are 300+ profiles in the database marked as Featured.  I've check a few of these in the admin area and sure enough the check box for Featured is ticked.

What I want to do is remove the marking that makes them featured.  I see in the database table Profile that the Featured column can be either 0, 1, or 2, so surely the command would be:

UPDATE 'Profiles' SET `Featured` =0 WHERE `Featured` =1

or

UPDATE 'Profiles' SET `Featured` =0 WHERE `Featured` =2

but these commands produce a syntax error.

Anyone know what the command would be?

And what's the difference between 1 and 2 anyway?  Surely it's either on or off since it's a checkbox?

Thanks Smile

Quote · 16 Aug 2008

Not sure, I'm not an expert... but as for me I would try to write the request in this order:

 

UPDATE 'Profiles' WHERE 'Featured' = 1 SET 'Featured' = 0

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 16 Aug 2008

Thanks for the suggestion MichelSwiss, but that doesn't work either.

UPDATE 'Profiles' WHERE 'Featured' =1 SET 'Featured' =0

MySQL said: Documentation

#1064 - 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 ''Profiles' WHERE 'Featured' = 1 SET 'Featured' = 0' at line 1

Quote · 16 Aug 2008

Maybe like that ???

 

UPDATE `Profiles` SET `Featured` = '0' WHERE `Featured` = '1';

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 16 Aug 2008

Well done Michel Cool

That's it - it just needs the values contained in inverted commas

Thank you Smile

Quote · 16 Aug 2008

You are welcome :-)

Yeah :-) Difficult to see that with small letters :-)  Because of that I used bigger characters ;-)

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 17 Aug 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.