my query donsn't return any record |
Who knows what the problem is?
PHP Code: SELECT `track`.`id`, `track`.`artist_id`, `track`.`genre_id`, `track`.`title`, `track`.`cover`, `track`.`exclusive`, `track`.`count_download`, `track`.`url`, `artists`.`id` `artid`, `artists`.`artist_name`, `g`.`id` `gid`, `g`.`name`
(08-31-2017, 04:43 AM)Narf Wrote: How can a LOWER()ed value start with a capital letter? mysql does not care. abcd is the same as AbCd (depend on the character collation). Does postgresql the same? I believe programmer use mysql and is a beginner. programmer delete an artists or genres and forgot to check if the value is needed. @programmer, A join is in mysql a inner join. If the artist_id or genre_id is null or the id value does not exist in artists/genres you get no records.
@programmer,
More information please... What database are you using? Version? Based on your joins what are you expecting to see? Are you sure that you are using the correct join?
Looks like you got syntax error in join such as
JOIN `artists` ON `artists`.`id` = `artist_id` JOIN `genres` AS `g` ON `g`.`id` = `genre_id` I think it should have been JOIN `artists` ON `artists`.`id` = `track`.`artist_id` JOIN `genres` AS `g` ON `g`.`id` = `track`.`genre_id` such as missing track Regards |
Welcome Guest, Not a member yet? Register Sign In |