I have 6 tables to display in a single query. At first I try to execute three tables, but there is an error, and I do not know why. I want to show all fields, but I tried using the first element code if you are going to work. Sorry, there is a mistake.
Error Warning: mysqli::query() [mysqli.query]: (21000/1242): Subquery returns more than 1 row in C:\wamp\www\DASMA\stockcard.php on line 541
I want to display all the data in my table if one of them has no data yet. Just without using an SQL join.
|allinvty3|(masterfile)
----------------
|in_code |
|ecr_desc |
|pric_cash
|qty |
|ite_desc |
---------------
|(barcode, soldout_dm , dm_stock_transfer, adjustment etc.
-all have same fieldname)|
----------------
|itemcode |
|qty |
|date
|qty |
|status |
---------------
<?php
$sql = "
SELECT (
SELECT itemcode as bcode
FROM barcode
) ,
(
SELECT itemcode as bsold
FROM soldout_dm
) ,
(
SELECT itemcode as bstock
FROM dm_stock_transfer
)
";
$result = $conn->query($sql);
?>
source
share