need help to edit script for making 1st photos prime

Quote from Mike Boucher on 2025-04-19, 12:11 pmUsed a script by Tom Holden to make the last photo prime. But my imported file used to designate the first photo as prime, but stopped doing that. So all set prime is set to 0. I would like to have some edits to the script to select the first photo as prime. It works fine in RM 10, but makes the last one prime, as originally intended.
Script is at:
https://sqlitetoolsforrootsmagic.com/media-set-primary-photo-for-persons/
I am not an sql programmer, so please be specific.
Thanks
Used a script by Tom Holden to make the last photo prime. But my imported file used to designate the first photo as prime, but stopped doing that. So all set prime is set to 0. I would like to have some edits to the script to select the first photo as prime. It works fine in RM 10, but makes the last one prime, as originally intended.
Script is at:
https://sqlitetoolsforrootsmagic.com/media-set-primary-photo-for-persons/
I am not an sql programmer, so please be specific.
Thanks

Quote from Tom Holden on 2025-04-19, 12:25 pmI added such a script yesterday, revised from the original, to the page Media - Set Primary Photo for Persons. The Recent Comments list in the sidebar shows that I commented on that post.
I added such a script yesterday, revised from the original, to the page Media - Set Primary Photo for Persons. The Recent Comments list in the sidebar shows that I commented on that post.