![]() |
Deleting entries directly from the database? Stripping commas from keywords? I had a user upload a ton of photos at once and it choked a couple times and uploaded some of them twice. I ran the dupe scanner and I think it got rid of most of them, but there are a few left. Can I go in to phpMyAdmin and delete their entries manually? Is that going to break anything? Also, he entered keywords separated by commas and now the commas are considered part of each keyword. Is there a quick way to strip all the commas from that field? I'd assume a quick MySQL query would do it, but I don't know how to construct it. Thanks. |
You can delete photo inserts yes but thats not going to delete the actual photos As far as commas on keywords HMM thats a powerful query so beware UPDATE pp_photos SET keywords = REPLACE(keywords, ',','') |
Thanks Chuck, I thought it would be doable, just didn't know how to write the query. Another question, can you tell me what's wrong with this query? Code: Content visible to verified customers only.I'm trying to return all keywords from all photos from certain categories that I specify. Later I might write it so that the array of categories is found by looking at the categories table to find children of a parent category, so I can say I want all keywords from a certain category and any children. Thanks. |
what is that keyword thing on the end that is not valid and is probally why the query fails. |
That evaluates where keywords exist, basically. It does work in a simpler query. I think mine is failing because of "AND WHERE". When I took out WHERE it seems to be getting further along. |
SELECT keywords FROM {$Globals['pp_db_prefix']}photos WHERE cat IN (501,502,503,504) Yep that would work. |
Yeah, I ended up with: SELECT keywords FROM {$Globals['pp_db_prefix']}photos WHERE keywords <> '' AND cat BETWEEN 512 AND 530 That works because the categories I wanted to pull from are all in a row from 512-530. |
got ya |
| All times are GMT -5. The time now is 08:10 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0