LiamH Posted July 21, 2009 Share Posted July 21, 2009 Hi all. I'm trying to update my website so that screen shots on an article page, when selected will open up a new window and display all of the images associated with that article. But I'm really not sure how to go about it. Would the best way to have 10 individual columns for screens in the articles table, or is it better to have just one column with all of the screenshot information contained in that? I honestly have no idea how to go forward with this, so if anyone has any helpful hints or advice, it would help greatly. Quote Link to comment Share on other sites More sharing options...
ignace Posted July 21, 2009 Share Posted July 21, 2009 That's actually entire up to you, plus this should have been posted in application design or something. Quote Link to comment Share on other sites More sharing options...
LiamH Posted July 21, 2009 Author Share Posted July 21, 2009 I went along the route of having 10 rows in the articles table, and can display the screenshots on the articles page no problem. It's when it comes to having them display in the image viewer page that I become a bit stuck. I'd only want one image to display at a time, so would need some form of page pagination, but with only the images location stored in the articles table, I'm not entirely sure how to go about doing it. And apologies for placing it in the wrong bit Quote Link to comment Share on other sites More sharing options...
LiamH Posted July 22, 2009 Author Share Posted July 22, 2009 Anyone have any ideas on how to get the pagination to work? Quote Link to comment Share on other sites More sharing options...
waynew Posted July 22, 2009 Share Posted July 22, 2009 You should have done it this way: Article table: article_id INT(11) NOT NULL AUTO_INCREMENT, article_name TEXT NULL <....> etc Screenshot table: CREATE TABLE IF NOT EXISTS screenshot( screenshot_id INT(11) NOT NULL AUTO_INCREMENT, article_id INT(11) NOT NULL, directory TEXT NOT NULL, INDEX article_index(article_id), PRIMARY KEY(screenshot_id)) Say I'm on article_id 32 and I click the screenshots page, your code should simply search through the screenshot table and pluck out any screenshots that have the article_id 32. Do you understand what I'm talking about? Quote Link to comment Share on other sites More sharing options...
LiamH Posted July 23, 2009 Author Share Posted July 23, 2009 Yes I understand. Will have a look at this and let you know how I get on. Thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.