This seemed to be a very simple thing to do at first, but is proving to be more difficult than I originally imagined. I'm sure it's quite simple, I just can't quite figure it out. Every piece of code I've tried doesn't quite work properly. Anyways, I digress.
This is for an updating script that I wrote, which does a recursive scan and if it's a file, adds it's Path, Name, and Extension to a mySQL Table. Right now I've got it so it uploads an entry for each file, but if I run it again it adds a duplicate entry. I don't want to just wipe the table each time, as I'd like for the ID# in the table to remain the same.
Anyways, any suggestions? If you want my current code just lemme know and I'll post it.
Thanks,
- Jesse
Check if Table Entry Exists
Moderator: General Moderators
Re: Check if Table Entry Exists
Make the path+name+extension a unique key and use an INSERT IGNORE query.
Re: Check if Table Entry Exists
I'll try that out, thanks.