0

I am creating a form to allow admin users to create new 'News' Items. I am using PHP Codeigniter. All works perfect at the moment storing and retrieving data from MYSQL database.

I have now realised I would like the option to add external URL links that relate to each news item. Possibility to add multiple links for each. I was thinking of adding a ´links´table to the database, foreign key relation with News table. Something like below:

tbl_news:

news_id,
title,
descrip,
...etc

tbl_link:

link_id,
title,
URL,
news_id

This will take a bit of processing as it is 2 input fields per link on the form and could become messy if the user adds multiple links per news item. Just wondering is there a better way to allow for URL input in a HTML form?

The Dude
  • 363
  • 1
  • 14
RebeccaRol
  • 123
  • 2
  • 13
  • 2
    What should be messy about that? If you need multiple links then you have to handle multiple links. That is called "reality". And it is exactly what relation databases are there for. – arkascha Oct 24 '16 at 08:09
  • You can use grid, where you can add multiple link for same news. – Roshan Dandgavhal Oct 24 '16 at 08:42

0 Answers0