Jump to content

Change value of several ids

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Bertan

Bertan

    Learning Programmer

  • Members
  • PipPipPip
  • 43 posts
I want to reset the image view count of all the images on my homepage. This code I have below will set the image count to 0 to the image with id1. However I have 4000+ images on the homepage is there any way to make a command that will change image view count to 0 for all images with image id 1 to 3000?

UPDATE `phpbb_gallery_images` SET `image_view_count` = '0' WHERE `phpbb_gallery_images`.`image_id` =1 LIMIT 1 ;


#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,298 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
UPDATE `phpbb_gallery_images` SET `image_view_count` = '0' WHERE `image_id` <= 3000;

__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
Bertan

Bertan

    Learning Programmer

  • Members
  • PipPipPip
  • 43 posts
Great, thanks for the help :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users