Mysql Join Query

You can use multiple tables in your single SQL query. The act of joining in MySQL refers to smashing two or more tables into a single table.

First you can need database connection in php


        $sql = "SELECT `cs`.`series_name`,`cs`.`series_id`,`cs`.`status`,`cs`.`created_date`,`cmm`.`model_name`,`cm`.`brand_name`,`cmm`.`seat` from `iosr_car_series` AS `cs` INNER JOIN `iosr_car_master` AS `cm` ON `cs`.`car_id` = `cm`.`car_id` INNER JOIN `iosr_car_model` AS `cmm` ON `cmm`.`model_id` = `cs`.`model_id` WHERE `cs`.`status` != 2"; 
        $result = mysqli_query($con,$sql);
        while($row = mysqli_fetch_assoc($result))

Leave a Reply

Your email address will not be published. Required fields are marked *