title: How to compare values in different tables and change the output in PHP?
body: <p>I don't know much about PHP so please excuse my inexperience. Here's my problem.</p>
  
  <p>I have 3 tables <a href="https://i.stack.imgur.com/p7VNb.jpg" rel="nofollow noreferrer">as seen here</a>.
  <br/><br/>
  I provide the user with checkboxes containing the values from table LOCAIS and CORES.</p>
  
  <p>If checked, the values are sent to the table INFO (I use implode, that's why you see rows with more than one number).</p>
  
  <p>What I need to do is this:</p>
  
  <p>When outputting the data from table INFO to the user, I need to change the values from columns LOCAL and COR for their respectives values in the tables LOCAIS and CORES.</p>
  
  <p>I don't want to change the values in the database, I just want to change the output based on the ID, in this case:</p>
  
  <pre><code>info.local = locais.id = locais.local
  2, 3 = 2, 3 = Portugal, Suiça
  
  info.cores = cores.id = cores.cor
  1 = 1 = Azul
  </code></pre>
  
  <p>PS: Table INFO has more columns. Each row is connected to a user ID so I can filter the entries and display it to the specific user.</p>
  
  <p>I tried a lot of things that didn't work but that was probably because of my inexperience.</p>
  
  <p>So how can I do this?</p>
  
  <hr>
  
  <p><strong>Edit 1:</strong> I need to display all the information from the row of table INFO and change the values shown based on the other two tables. So if in the table INFO the row has these values:<br/>
  "ID: 1 Local: 1 Cor: 2, 3"<br/>
  the output would be<br/>
  "ID1, Local: "Brasil, Cor: Verde, Vermelho".</p>