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 question....my php doesn't recognize $row but it does recognize $row[6].

Member Avatar for diafol

Try:

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.