What are some potential performance implications of using a JOIN without an ON clause in a SQL query?

Using a JOIN without an ON clause in a SQL query can result in a Cartesian product, where every row from the first table is matched with every row from the second table. This can lead to a significantly larger result set than intended and can cause performance issues due to the increased number of rows being processed. To solve this issue, always specify the join condition in the ON clause to ensure that only the relevant rows are matched between the tables.

$query = "SELECT * FROM table1 JOIN table2 ON table1.id = table2.id";
$result = mysqli_query($connection, $query);