I am trying to execute a mysql query-
I keep getting a concatination error-
"Use of uninitialized value in concatenation (.) or string"
Is there a problem with this sql for DBI?
Code:
$sql = "SELECT S.supplier, S.sup_img, C.prodid, D.product, D.catid, C.minprice
FROM suppliers S
INNER JOIN (SELECT B.supplierid, A.prodid, A.minprice
FROM sup_prices B
INNER JOIN (SELECT X.prodid, MIN(X.price_each) minprice
FROM sup_prices X
INNER JOIN (SELECT PP.prodid, PP.product
FROM products PP
INNER JOIN prefs PR
ON PP.catid = PR.catid
AND PP.prodid = PR.pref
WHERE userid = $urow->{userid}) Y
ON X.prodid = Y.prodid
GROUP BY X.prodid) A
ON B.prodid = A.prodid
AND B.price_each = A.minprice) C
ON S.supplierid = C.supplierid
INNER JOIN products D
ON C.prodid = D.prodid
ORDER BY D.catid";
$result = $dbh->prepare($sql)
$result->execute();
"Use of uninitialized value in concatenation (.) or string"
Is there a problem with this sql for DBI?