Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch enter images and keywords into image database

Status
Not open for further replies.

luvfool313

Technical User
Apr 12, 2002
3
0
0
US
I'm in the process of creating an image database with search capabilities. Is there a way to batch enter images into the database as well as batch enter key words? Like if I wanted the key words "dog, animal, pet" for images "dog001 - dog050" can I somehow batch enter this information so that I don't have to do it for each image separately? Any input and suggestion would be greatly appreciated! :)
 
You could do it "after the fact" fairly easily, with something like:
Code:
UPDATE myImageTable
   SET keywords = 'dog, animal, pet'
 WHERE imageName LIKE 'dog%'

But to do it when the image is initially inserted would be a bit more complex. You'd probably get a file listing with a CFDIRECTORY, step through it file by file, then create some sort of hairy CFIF statement like:
Code:
<CFIF Left(myImageName,3) EQ 'dog'>
   <CFSET myKeywords = &quot;dog, animal, pet&quot;>

      :
<CFIF>

<CFQUERY name=&quot;myInsert&quot; ...>
INSERT INTO myImageTable
   (imageName, kword) VALUES ('#myImageName#','#myKeywords#')
</CFQUERY>
Hope it helps,
-Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top