RE: [PHP] Using MySQL user variables in PHP

From: Date: Sun, 26 Jan 2003 18:36:08 +0000
Subject: RE: [PHP] Using MySQL user variables in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133184@lists.php.net to get a copy of this message
> -----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. mark C.

« previous php.general (#133184) next »