MySQL Forums
Forum List  »  Newbie

Re: JOIN works in phpMyAdmin, but not mysqli()
Posted by: Barry Galbraith
Date: January 27, 2023 06:15PM

$sql = "SELECT * FROM items JOIN owners WHERE items.ownerid = owners.id;";
                                                                       ^

Lose the semicolon in your SQL, like this
$sql = "SELECT * FROM items JOIN owners WHERE items.ownerid = owners.id";

BTW, you should SELECT the columns you want, rather than SELECT *.

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: JOIN works in phpMyAdmin, but not mysqli()
January 27, 2023 06:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.