How can I get these through INNER JOIN?How can I prevent SQL injection in PHP?UTF-8 all the way throughINNER JOIN ON vs WHERE clauseHow do I get PHP errors to display?How to get a list of MySQL user accountsHow do I get a YouTube video thumbnail from the YouTube API?How do I check if a string contains a specific word?What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN?Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in [dupe]Inner join of two tables [UPDATED]

how do we prove that a sum of two periods is still a period?

How to find if SQL server backup is encrypted with TDE without restoring the backup

Do Iron Man suits sport waste management systems?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Is "/bin/[.exe" a legitimate file? [Cygwin, Windows 10]

Calculate the Mean mean of two numbers

Processor speed limited at 0.4 Ghz

How to enclose theorems and definition in rectangles?

Machine learning testing data

Different meanings of こわい

What is an equivalently powerful replacement spell for Yuan-Ti's Suggestion spell?

Why is the sentence "Das ist eine Nase" correct?

How do I exit BASH while loop using modulus operator?

How does a dynamic QR code work?

What is the fastest integer factorization to break RSA?

How to install cross-compiler on Ubuntu 18.04?

Am I breaking OOP practice with this architecture?

Why was the shrink from 8″ made only to 5.25″ and not smaller (4″ or less)

How can a day be of 24 hours?

Unlock My Phone! February 2018

Placement of More Information/Help Icon button for Radio Buttons

Bullying boss launched a smear campaign and made me unemployable

What historical events would have to change in order to make 19th century "steampunk" technology possible?

Avoiding the "not like other girls" trope?



How can I get these through INNER JOIN?


How can I prevent SQL injection in PHP?UTF-8 all the way throughINNER JOIN ON vs WHERE clauseHow do I get PHP errors to display?How to get a list of MySQL user accountsHow do I get a YouTube video thumbnail from the YouTube API?How do I check if a string contains a specific word?What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN?Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in [dupe]Inner join of two tables [UPDATED]













-2















<?php 
$employee_id = $_SESSION['employee_id'];
$empquery= mysqli_query($db,"select * from employees WHERE `employee_id` = '$employee_id'");
While ($rowemp= mysqli_fetch_assoc($empquery))

$branch_name = $rowemp['branch_name'];

$query= mysqli_query($db,"select * from asset_evaluation WHERE `status` = 'NEW' AND `branch_name` = '$branch_name' ");
while($row= mysqli_fetch_assoc($query))

$supplier_cnic = $row['supplier_cnic'];

$supplier = mysqli_query($db, "select `supplier_name` FROM suppliers
WHERE `supplier_cnic` = '$supplier_cnic' ");
$outputrow = $supplier->fetch_assoc();
$suppplier_name = $outputrow['supplier_name'];

//echo all values










share|improve this question
























  • Please take care to format your code properly.

    – Pupil
    Mar 11 at 6:50











  • What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

    – Qirel
    Mar 11 at 6:52






  • 1





    without your table structure or key relationship.We cant tell inner join

    – prasanth
    Mar 11 at 6:53











  • Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

    – lostAtSeaJoshua
    Mar 11 at 6:54











  • which two table you want to join? and what's your foreign key and key relation?

    – Luffy
    Mar 11 at 6:56















-2















<?php 
$employee_id = $_SESSION['employee_id'];
$empquery= mysqli_query($db,"select * from employees WHERE `employee_id` = '$employee_id'");
While ($rowemp= mysqli_fetch_assoc($empquery))

$branch_name = $rowemp['branch_name'];

$query= mysqli_query($db,"select * from asset_evaluation WHERE `status` = 'NEW' AND `branch_name` = '$branch_name' ");
while($row= mysqli_fetch_assoc($query))

$supplier_cnic = $row['supplier_cnic'];

$supplier = mysqli_query($db, "select `supplier_name` FROM suppliers
WHERE `supplier_cnic` = '$supplier_cnic' ");
$outputrow = $supplier->fetch_assoc();
$suppplier_name = $outputrow['supplier_name'];

//echo all values










share|improve this question
























  • Please take care to format your code properly.

    – Pupil
    Mar 11 at 6:50











  • What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

    – Qirel
    Mar 11 at 6:52






  • 1





    without your table structure or key relationship.We cant tell inner join

    – prasanth
    Mar 11 at 6:53











  • Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

    – lostAtSeaJoshua
    Mar 11 at 6:54











  • which two table you want to join? and what's your foreign key and key relation?

    – Luffy
    Mar 11 at 6:56













-2












-2








-2








<?php 
$employee_id = $_SESSION['employee_id'];
$empquery= mysqli_query($db,"select * from employees WHERE `employee_id` = '$employee_id'");
While ($rowemp= mysqli_fetch_assoc($empquery))

$branch_name = $rowemp['branch_name'];

$query= mysqli_query($db,"select * from asset_evaluation WHERE `status` = 'NEW' AND `branch_name` = '$branch_name' ");
while($row= mysqli_fetch_assoc($query))

$supplier_cnic = $row['supplier_cnic'];

$supplier = mysqli_query($db, "select `supplier_name` FROM suppliers
WHERE `supplier_cnic` = '$supplier_cnic' ");
$outputrow = $supplier->fetch_assoc();
$suppplier_name = $outputrow['supplier_name'];

//echo all values










share|improve this question
















<?php 
$employee_id = $_SESSION['employee_id'];
$empquery= mysqli_query($db,"select * from employees WHERE `employee_id` = '$employee_id'");
While ($rowemp= mysqli_fetch_assoc($empquery))

$branch_name = $rowemp['branch_name'];

$query= mysqli_query($db,"select * from asset_evaluation WHERE `status` = 'NEW' AND `branch_name` = '$branch_name' ");
while($row= mysqli_fetch_assoc($query))

$supplier_cnic = $row['supplier_cnic'];

$supplier = mysqli_query($db, "select `supplier_name` FROM suppliers
WHERE `supplier_cnic` = '$supplier_cnic' ");
$outputrow = $supplier->fetch_assoc();
$suppplier_name = $outputrow['supplier_name'];

//echo all values







php mysql mysqli






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 21 at 20:38









halfer

14.7k759116




14.7k759116










asked Mar 11 at 6:47









M ZOHAIB KtkM ZOHAIB Ktk

31




31












  • Please take care to format your code properly.

    – Pupil
    Mar 11 at 6:50











  • What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

    – Qirel
    Mar 11 at 6:52






  • 1





    without your table structure or key relationship.We cant tell inner join

    – prasanth
    Mar 11 at 6:53











  • Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

    – lostAtSeaJoshua
    Mar 11 at 6:54











  • which two table you want to join? and what's your foreign key and key relation?

    – Luffy
    Mar 11 at 6:56

















  • Please take care to format your code properly.

    – Pupil
    Mar 11 at 6:50











  • What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

    – Qirel
    Mar 11 at 6:52






  • 1





    without your table structure or key relationship.We cant tell inner join

    – prasanth
    Mar 11 at 6:53











  • Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

    – lostAtSeaJoshua
    Mar 11 at 6:54











  • which two table you want to join? and what's your foreign key and key relation?

    – Luffy
    Mar 11 at 6:56
















Please take care to format your code properly.

– Pupil
Mar 11 at 6:50





Please take care to format your code properly.

– Pupil
Mar 11 at 6:50













What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

– Qirel
Mar 11 at 6:52





What exactly are you asking? How to convert your current code into a single query using JOIN? Well... What have you tried so far?

– Qirel
Mar 11 at 6:52




1




1





without your table structure or key relationship.We cant tell inner join

– prasanth
Mar 11 at 6:53





without your table structure or key relationship.We cant tell inner join

– prasanth
Mar 11 at 6:53













Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

– lostAtSeaJoshua
Mar 11 at 6:54





Please ask one clear concise question when asking for help on a topic. Adjust your title to ask what output you are trying to receive with an inner joins. Define what "these" is in your question title "How can i get these through INNER JOINT"

– lostAtSeaJoshua
Mar 11 at 6:54













which two table you want to join? and what's your foreign key and key relation?

– Luffy
Mar 11 at 6:56





which two table you want to join? and what's your foreign key and key relation?

– Luffy
Mar 11 at 6:56












1 Answer
1






active

oldest

votes


















-1














It's not rocket science...



SELECT c.olumns
, y.ou
, a.ctually
, w.ant
FROM employees e
JOIN asset_evaluation a
ON a.branch_name = e.branch_name
JOIN suppliers s
ON s.supplier_cnic = a.supplier_cnic
WHERE e.employee_id = :employee_id
AND a.status = 'NEW'





share|improve this answer

























  • I don't see a need to be condescending

    – dashnick
    Mar 27 at 20:36











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55096517%2fhow-can-i-get-these-through-inner-join%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









-1














It's not rocket science...



SELECT c.olumns
, y.ou
, a.ctually
, w.ant
FROM employees e
JOIN asset_evaluation a
ON a.branch_name = e.branch_name
JOIN suppliers s
ON s.supplier_cnic = a.supplier_cnic
WHERE e.employee_id = :employee_id
AND a.status = 'NEW'





share|improve this answer

























  • I don't see a need to be condescending

    – dashnick
    Mar 27 at 20:36















-1














It's not rocket science...



SELECT c.olumns
, y.ou
, a.ctually
, w.ant
FROM employees e
JOIN asset_evaluation a
ON a.branch_name = e.branch_name
JOIN suppliers s
ON s.supplier_cnic = a.supplier_cnic
WHERE e.employee_id = :employee_id
AND a.status = 'NEW'





share|improve this answer

























  • I don't see a need to be condescending

    – dashnick
    Mar 27 at 20:36













-1












-1








-1







It's not rocket science...



SELECT c.olumns
, y.ou
, a.ctually
, w.ant
FROM employees e
JOIN asset_evaluation a
ON a.branch_name = e.branch_name
JOIN suppliers s
ON s.supplier_cnic = a.supplier_cnic
WHERE e.employee_id = :employee_id
AND a.status = 'NEW'





share|improve this answer















It's not rocket science...



SELECT c.olumns
, y.ou
, a.ctually
, w.ant
FROM employees e
JOIN asset_evaluation a
ON a.branch_name = e.branch_name
JOIN suppliers s
ON s.supplier_cnic = a.supplier_cnic
WHERE e.employee_id = :employee_id
AND a.status = 'NEW'






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 21 at 21:21

























answered Mar 11 at 7:02









StrawberryStrawberry

26.8k83250




26.8k83250












  • I don't see a need to be condescending

    – dashnick
    Mar 27 at 20:36

















  • I don't see a need to be condescending

    – dashnick
    Mar 27 at 20:36
















I don't see a need to be condescending

– dashnick
Mar 27 at 20:36





I don't see a need to be condescending

– dashnick
Mar 27 at 20:36



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55096517%2fhow-can-i-get-these-through-inner-join%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript