Hi,
All i want to show is the 'fr_players' to have two categories of 'fr_nations' and 'fr_clubs' and fetch the names from the foreign id...
Here what i have done so far but it doesnt shows any error or return any tables either:
SELECT a.id as club_id,
a.fr_name as club_name,
b.id as nation_id,
b.fr_name as nation_name,
c.id as player_id,
c.fr_fname as player_name"
." FROM fr_clubs as a
INNER JOIN fr_nations as b ON a.id = b.club_id
INNER JOIN fr_players as c ON b.id = c.nation_id"
." LIMIT $paginate->start, $paginate->limit
here is the table structure:
CREATE TABLE IF NOT EXISTS `fr_clubs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fr_name` varchar(100) NOT NULL,
`fr_nickname` varchar(100) NOT NULL,
`fr_chairman` varchar(100) NOT NULL,
`fr_coach` varchar(100) NOT NULL,
`league_id` int(11) NOT NULL COMMENT 'Foreign Key',
`fr_logo` varchar(100) NOT NULL,
`fr_bio` text NOT NULL,
`fr_founded` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='clubs Details' AUTO_INCREMENT=22 ;
CREATE TABLE IF NOT EXISTS `fr_nations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fr_name` varchar(100) NOT NULL,
`fr_full_name` varchar(100) NOT NULL,
`fr_nickname` varchar(100) NOT NULL,
`fr_coach` varchar(100) NOT NULL,
`fr_captain` varchar(100) NOT NULL,
`fr_logo` varchar(100) NOT NULL,
`fr_bio` text NOT NULL,
`confed_id` int(11) NOT NULL COMMENT 'Foreign Key',
`club_id` int(11) NOT NULL COMMENT 'Foreign Key',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='nations Details' AUTO_INCREMENT=37 ;
CREATE TABLE IF NOT EXISTS `fr_players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nation_id` int(11) NOT NULL COMMENT 'Foreign Key',
`fr_fname` varchar(100) NOT NULL,
`fr_lname` varchar(100) NOT NULL,
`fr_nickname` varchar(100) NOT NULL,
`fr_position` varchar(100) NOT NULL,
`fr_town` varchar(100) NOT NULL,
`club_id` int(11) NOT NULL COMMENT 'Foreign Key',
`fr_dob` varchar(100) NOT NULL,
`fr_nation_number` float NOT NULL,
`fr_club_number` float NOT NULL,
`fr_image` varchar(50) NOT NULL,
`fr_height` float NOT NULL,
`fr_bio` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='players Details' AUTO_INCREMENT=23 ;
Any help will be appreciated, Thanks!