GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   mySQL help please (https://gfy.com/showthread.php?t=789417)

d-null 12-04-2007 02:06 AM

mySQL help please
 
did this query:

UPDATE `BLOG_MEMBERS` SET `M_STAT` = '1' WHERE `BLOG_MEMBERS`.`MEMBER_ID` =612 LIMIT 1 ;

I am curious what the "limit 1" does?

I am curious how I would modify the syntax of the same query to automatically do all member_id from say 1 to 612?


thanks

Bro Media - BANNED FOR LIFE 12-04-2007 02:19 AM

limit 1 makes sure that it only updates 1 record

d-null 12-04-2007 03:37 AM

thanks

do I need to set up some kind of loop query to change all the records in one field?

(Im a newbie to the sql query thing)

DaveKnell 12-04-2007 03:56 AM

Nope - just make your where clause something like
where member_id>=1 and member_id<=612

--Dave

d-null 12-04-2007 03:57 AM

:thumbsup thanks Dave, off to experiment

donborno 12-04-2007 04:18 AM

Quote:

Originally Posted by DaveKnell (Post 13467994)
Nope - just make your where clause something like
where member_id>=1 and member_id<=612

--Dave

Rather use
Code:

WHERE member_id BETWEEN 1 AND 612


All times are GMT -7. The time now is 02:37 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123