Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming the field from 0 to 1

Status
Not open for further replies.

thebabes

IS-IT--Management
Mar 6, 2005
2
NO
hi guys and gals

just wondering how can i rename the field
auto_viewimage to 1 for all of the cat_id in my DB

I used the query below to change the auth_viewimage from 0 to 1 , but would like to know the query how i can have something like

UPDATE `4images_categories` SET `auth_viewimage` = '1' WHERE `cat_id` =337 LIMIT 1

cat_id = 1,1000 or upto the last category id

thx a mill

 
hi

Well i have a celebrity site where i want to allow users to DOWNLOAD images, by having the field show 1 in auth_viewimage

like this

auth_viewimage = 1

at the moment it shows

auth_viewimage = 0


So i was wondering what query would i run to update the whole db so all

cat_id from 1 to the MAX be updated..

so as you can see the query above

UPDATE `4images_categories` SET `auth_viewimage` = '1' WHERE `cat_id` =337 LIMIT 1


The above query was to update the CAT_ID = 337 so users could see pics there, i want to see how can i in MYSQL set FROM and TO for the cat_ids as they all the way upto 500 or so..

something like this

UPDATE `4images_categories` SET `auth_viewimage` = '1' WHERE `cat_id` =1 TO 500 LIMIT 1


 
To specify a range of values for cat_id, you could use:
[tt]
WHERE cat_id BETWEEN 1 AND 500
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top