sql - MYSQL select in different table with condition -


update

i know variable $id id of data in table_1. have 2 same columns in table_1 , table_2 (with same content). want select , show column in table_2 (result).

table 1

|     id        |      color      |  -----------------------------------        1        |      data1      |             2        |      data2      |           3        |      data3      |             4        |      data4      |           5        |      data5      |     

table 2

|     id        |      flower     |      result      |  ------------------------------------------------------        11       |      data1      |     result1      |            12       |      data2      |     result2      |             13       |      data3      |     result3      |              14       |      data4      |     result4      |               15       |      data5      |     result5      |     

ex
id = 5
result = result5

select t2.*, t1.color t2 inner join t1 on t1.color = t2.data , t1.id = '$id' 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -