I have two tables. Table_1 have this fields.
table_1_id
name
image
adres
Table_2
table_2_id
name
email
phone
comment
datetime
need_id
I want to make when I click on the ID_1 form table_1 to load me all rows from table_2 which have table_1_id = 1
I've tried with this query
SELECT t1*, t2.* FROM table_1 t1, table_2 t2
WHERE t1.table_1_id = t2.need_id ORDER BY `DateTime` DESC
and show blank page. Then I tried like this
SELECT t1.*, t2.* FROM table_1 t1
JOIN table_2 t2 ON t1.table_1_id = t2.need_id ORDER BY ` DateTime` DESC
This whatever I click is returned first 5 results from database and that's it.