0

<code><pre>
SELECT 
    bs.bid AS id,
    bs.bname AS bname,
    bs.blocation AS bloc,
    bs.btype AS btype,
    bs.bcontact AS bcontact,
    bs.bnature AS bnature,
    bs.bturnover AS bturnover,
    bs.bdate AS bdate,
    bs.bcdate AS createdate,
    bs.bstatus AS bstatus,
    ad.astreet AS bstreet,
    ad.atown AS btown,
    ad.adistrict AS bdistrict
FROM
    oa_business AS bs
        INNER JOIN
    oa_address AS ad ON bs.blocation = ad.aid
WHERE
    (ad.astreet LIKE '%2%')
ORDER BY bname ASC
</pre>
</code>
The code above does work fine in workbench. However, when this code is run using php mysqli oops i get "unknown Column ad.astreet in the where clause" Thank You for your help
ADyson
  • 57,178
  • 14
  • 51
  • 63
Kanneh
  • 1
  • 1
  • @Cid sorry it actaully "Unknown column" – Kanneh Mar 07 '22 at 07:20
  • Most likely explanation is that your php code isn't looking at the same copy of the database that workbench is. Either that or you're not executing the php code you think you are. – ADyson Mar 07 '22 at 07:26
  • @ADyson Thank you very much you made me look deeper and the error is from another line using the same filter which is not a join. – Kanneh Mar 07 '22 at 07:39

0 Answers0