Re: Using MySQL user variables in PHP
| From: | Jason Wong | Date: | Sun, 26 Jan 2003 19:36:40 +0000 |
| Subject: | Re: Using MySQL user variables in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133186@lists.php.net to get a copy of this message | ||
On Monday 27 January 2003 02:36, Mark Charette wrote:
> > -----Original Message-----
> > From: Jason Wong [mailto:php-general@gremlins.biz]
> >
> > > 2. $tempQuery1 = "
> > > SELECT @most_recent:=MAX(date) from presenters";
> > > $tempQuery2 = "
> > > SELECT @recent_presenter:=presenter FROM presenters WHERE
> > > date=@most_recent;
> > > $presenterQuery = "
> > > SELECT date_format(p.date, '%d/%m/%y') AS
> >
> > readable_date, p.theme,
> >
> > > p.presenter,
> > > c.itemNo, c.composer, c.composition, c.note
> > > FROM presenters p, compositions c
> > > WHERE p.date = c.date AND p.presenter = @recent_presenter
> > > ORDER BY p.date DESC";
> >
> > You're not doing anything with $tempQuery1 & $tempQuery2 this is complete
> > nonsense ;-)
>
> Not true - this is using MySQL's variable approach. The '@xxxx' represents
> a user variable per connection in MySQL. See
> http://www.mysql.com/doc/en/Variables.html for more
> information.
I know. The important point is that although $tempQuery1 & $tempQuery2 are
assigned, they aren't being passed to any mysql_query().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Music in the soul can be heard by the universe.
-- Lao Tsu
*/