The OwnerName field in the Catalog table exactly matches the Name field in the Owner table, which is that table's primary key.

My select statement
select Catalog.*,Owner.* from Catalog, Owner where Authors like "%jam%" and Catalog.OwnerName=Owner.Name order by Title limit 0,100

I use {$num_rows = mysqli_num_rows($result); to get my results. This gets all "n" fields of the Catelog table correctly in $row[n], but I can't get the fields from the Owner table.

Another php doesn't recognize $row but it does recognize $row[6].

Member Avatar


SELECT `Catalog`.*,`Owner`.* FROM `Catalog` INNER JOIN `Owner` ON `Catalog`.`OwnerName` = `Owner`.`Name` WHERE `Catalog`.`Authors` LIKE "%jam%" ORDER BY `Catalog`.`Title` LIMIT 0,100

BTW Name is a preserved word in MySQL, so you have to back tick it. I'm surprised you didn't get an error for this.

commented: Perfect-thx a million +1