title: Store Multiple image URLs in a single row in database
body: <p>I need to store multiple images in a row. So, I can follow two approches. </p>
  
  <p><strong>1. First Way</strong></p>
  
  <p>One approach is 1NF form (which should be avoided as I have read in books).</p>
  
  <p>I will create a table <strong>Feed</strong> with a column url and store several URLs separated by a Comma</p>
  
  <p><strong>id</strong> <strong>url</strong></p>
  
  <p>1  a.jpg,b.jpg,c.jpg</p>
  
  <p>2 xyz.jpg,image.jpg</p>
  
  <p>To retrieve images, I would use explode()</p>
  
  <pre><code>  $photos = explode(' , ', $url);
  </code></pre>
  
  <p><strong>2. Second way</strong></p>
  
  <p>The second way is to normalize the table and create a separate image table with a Many to One relationship with table Feed</p>
  
  <p>Feed table:</p>
  
  <p><strong>id</strong></p>
  
  <p>1</p>
  
  <p>2</p>
  
  <p>Image table: </p>
  
  <p><strong>fid</strong> <strong>url</strong></p>
  
  <p>1 a.jpg</p>
  
  <p>1 b.jpg</p>
  
  <p>1 c.jpg</p>
  
  <p>I want to know why we should avoid the first approach? or is it ok to use first approach for just small projects?</p>