mysqlphpmyadminfieldfield-names

It won't show name from parent table, only number or id


This is my query. It show results but instead of name of the day it shows only number or id. How to change it?

SELECT challenger, challenged, day_id, date_match, CONCAT(term_start,' - ',term_end) 
AS term FROM barbara_schedule 
INNER JOIN barbara_days ON barbara_schedule.day_id = barbara_days.id_day 
ORDER BY date_match, term_start ASC 

Solution

  • You're only selecting day_id (from the table which I think also contains the actual day).

    Add the name of the day column name to your query.