Does anyone know how, in MySQL, one might instruct it to search for all posts before a certain date, check if a variable = 2 or 1, and if so, make it = 0? I had MT-CloseComments on for a while, then MT-B came out which is much better but in the old pre-MT weblog I didn’t have comments anyhow, so there’s no point in even having the line there saying Comments (0). Which will disappear if I set the variable to 0 in MT, but which I decidedly do NOT want to do one-by-one.
Michael says
OH – one more detail – I want to do this once and then not worry about it again (MT-B will take care of things).
BB says
Isn’t is something like this:
update tablename
set field_to_update = 0
where field_to_update > 0
and date_field
Michael says
Thanks B – I’ll take a look.
Alan says
I’d make that
[UPDATE table_name
SET field_to_update = 0
WHERE (field_to_update = 1
OR field_to_update = 2)
AND date_field
You might also find this useful
http://www.birdbrained.org/blog/archives/000046.php
Alan says
(btw. your comment preview is stripping HTML tags, while your posting allows them (: )
Michael says
Thanks! Prompted by your post I in fact when to Jason Levine’s Q Daily News and used a script he recently put together, but in a bit of a different way than he did. I just set the date to 351 days and changed the action the script took (changed the value to 0 for older posts, which were pre-MT for me) and saved it in my root and it worked like a charm in about a second.
Since I only had to do this once, I just trashed the script after.
Michael says
BTW Thanks for noting the problem with my comments. My whole comments section is screwed at the moment, though the bare bones works OK.