in reply to Re^6: sql join with multiple select
in thread sql join with multiple select

If your user table is this

TABLE users userid FNAME LNAME 1 JOHN DEO 2 JANE DEO

this line

my $data = $DBH->prepare("SELECT SND.userid, SND.firstname, SND.lastname

give the error

DBD::mysql::st execute failed: Unknown column 'SND.firstname' in 'field list'

If I correct that error, the next error is

Not an ARRAY reference
at this line

    foreach $row ( @$data) {

because as I told you here $data is a statement handle not an array refence

I don't know what code you have that is working but it's not what you posted.

poj

Replies are listed 'Best First'.
Re^8: sql join with multiple select
by bigup401 (Pilgrim) on Oct 04, 2018 at 15:27 UTC

    ya its userid, snd.fname, snd.lname

    but that error ur getting Not an ARRAY reference

    i dont get it here for sure

      but that error ur getting Not an ARRAY reference

      i dont get it here for sure

      Then the code you're posting is not the code you're running. And the carousel begins another round.


      Give a man a fish:  <%-{-{-{-<