[thelist] MYSQL Select from Table(s)
sulasmin suruji
sazmin_alyin at yahoo.com
Fri Apr 20 02:46:38 CDT 2001
--- Adrian Fischer <adrian at logo-logic.com> wrote:
> Hi Gang,
>
> Thanks for the tips on db to ms word the other
> night. Got it working fine
> (haven't got it into word yet but can at least get
> the info from the db and
> have it delimited with what ever I like..just need
> to work out what is best
> for import into word as a data file...)
>
> Any way..today's problem is; I have 3 tables which
> all contain records
> that are not related but they all have an email
> column. I want to be able
> to pull an email from any of the three if it meets a
> criteria.
>
> sort of like this:
> <snip>
> my $db = &dbconnect;
> my $dbh=$db->prepare("SELECT State FROM tblAds WHERE
> Email ='$email' ");
> $dbh->execute();
> ($docstate) = $dbh->fetchrow_array();
> </snip>
> ($email is the criteria and is passed from another
> sub)
>
> this works for "tblAds" but I also have "tblDockets"
> and "tblReward" I want
> to be able to do something like: "SELECT State FROM
> tblAds,tbleDockets,tblReward WHERE Email ='$email' "
> but that doesn't work.
> I don't want to have to write three select
> statements unless there is no
> work around.
>
> Any ideas
>
> Thanks
>
> Adrian Fischer
>
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
More information about the thelist
mailing list