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]
<?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
|
show 3 more comments
<?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
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 usingJOIN
? 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
|
show 3 more comments
<?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
<?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
php mysql mysqli
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 usingJOIN
? 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
|
show 3 more comments
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 usingJOIN
? 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
|
show 3 more comments
1 Answer
1
active
oldest
votes
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'
I don't see a need to be condescending
– dashnick
Mar 27 at 20:36
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'
I don't see a need to be condescending
– dashnick
Mar 27 at 20:36
add a comment |
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'
I don't see a need to be condescending
– dashnick
Mar 27 at 20:36
add a comment |
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'
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'
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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