PhotoPost Community

PhotoPost Community (http://www.photopost.com/forum/)
-   Photopost Pro How Do I...? (http://www.photopost.com/forum/photopost-pro-how-do-i/)
-   -   Deleting entries directly from the database? Stripping commas from keywords? (http://www.photopost.com/forum/photopost-pro-how-do-i/135289-deleting-entries-directly-database-stripping-commas-keywords.html)

styleforum February 4th, 2008 05:19 PM

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.

Chuck S February 4th, 2008 07:19 PM

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, ',','')

styleforum February 4th, 2008 09:33 PM

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.
It breaks here and I'm not sure why. I'm having a hard time finding references that explain how to formulate queries.

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.

Chuck S February 4th, 2008 09:37 PM

what is that keyword thing on the end that is not valid and is probally why the query fails.

styleforum February 4th, 2008 10:03 PM

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.

Chuck S February 5th, 2008 08:55 AM

SELECT keywords FROM {$Globals['pp_db_prefix']}photos WHERE cat IN (501,502,503,504)

Yep that would work.

styleforum February 5th, 2008 01:56 PM

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.

Chuck S February 5th, 2008 02:46 PM

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


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97