Re: php mySQL SQL question

by "Michael Gerholdt" <gerholdt(at)fredonia.edu>

 Date:  Thu, 8 Mar 2001 22:57:43 -0500
 To:  "Mukesh Wani" <mukeshwani(at)hotmail.com>,
"hwg-languages" <hwg-languages(at)hwg.org>
 References:  pmg hotmail
  todo: View Thread, Original

> well, it would work if mySQL supported sub-queries... :-), its one of the
> things missing in this RDBMS.

Yikes! Then what? Run a query, fetch into an array, and then run a second
query?

That's not an attractive option at this point.

Major bummer! Any other way to do what this subquery wants to do?

> >
> > $strSQL = "SELECT DATE_FORMAT(event_time, '%M %e %Y, %l:%i %p'),
bandname,
> > image ";
> > $strSQL .= "FROM doings, styles ";
> > $strSQL .= "WHERE style = musicstyle ";
> > $strSQL .= "AND bandname LIKE '$artist' ";
> > $strSQL .= "AND style LIKE '$style' ";
> > $strSQL .= "AND (SELECT DATE_FORMAT(event_time, '%b') FROM doings) LIKE
> > '$month' ";
> > $strSQL .= "ORDER BY event_time";
> > echo "$strSQL<BR>";
> >
> > $month will be carrying the three-character short version of the alpha
> month
> > name.
> >
> > I don't think it likes my subquery, though I like it just fine.
> >

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA