0

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].

Edited by bob on whidbey: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by diafol
1

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.

Votes + Comments
Perfect-thx a million
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.