Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

MySQL Multiple Joins in one Query

by
Category:mysql
php
MySQL Multiple Joins in one 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.

Assume we have two or more tables in TUTORIALS. Now take a look at the examples given below. You may also like MySQL Multiple Left Joins in one Query and Mysql Join Query.

First you can need database connection in php

Code

$sql = "SELECT wo_jobs.* FROM wo_jobs INNER JOIN wo_clients ON wo_clients.id = wo_jobs.client_id INNER JOIN wo_sectors ON wo_sectors.id = wo_jobs.sector_id WHERE wo_jobs.jobcode = '154' "; 
$result = mysqli_query($con,$sql);

0 Comments


Html code work in comment box


Related Post