Hi Guys,
This is driving me potty and would really appreciate some help and you guys are always very helpful!
I’m building a Content Management system and I’m looking to assign pictures to stories.
Now all images are already uploaded via a separate form in a table called cms_pictures table and are re-sized on the fly.
Now in my two tables:
cms_stories
story_id int(4) No auto_increment
headline varchar(128) latin1_swedish_ci No
body_text text latin1_swedish_ci No
cms_pictures
pic_id int(3) No auto_increment
date_uploaded varchar(200) latin1_swedish_ci No
main_dir varchar(200) latin1_swedish_ci No
main_name varchar(200) latin1_swedish_ci No
thumb_dir varchar(200) latin1_swedish_ci No
thumb_name varchar(200) latin1_swedish_ci No
I need to link these two tables together to assign pictures to stories.
But I am completely stuck!
If you would be kind enough to take a look at:
http://www.slougheaz.org/greenock/news_test/test.php
There is a form for adding data to the cms_stories table with a Javascript prompt at the bottom which searches for images in the cms_pictures table.
What this does is launch a new window which searches for images in the cms_pictures table. So if you search for the word caption it returns results.
Now This is the bit i'm stuck on - what I want to be able to do is click on the image. Then in the background of the page the pic_id of the image from the cms_pictures table is assigned to the cms_stories table so it has a reference to it.
Then I can simpy hit submit and the data for form andthe cms_stories data is saved together with a refence to the image assigned to that story.
Could anyone please advise me:
A) How I can progress further with this from where I am stuck
😎 If there is a simpler way anyone can think of assigning pictures to stories and have I been thinking too hard about this.
Many Thanks
Chris