Re: Query works but can't echo variable :'(

From: Date: Mon, 27 Oct 2003 00:26:25 +0000
Subject: Re: Query works but can't echo variable :'(
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31308@lists.php.net to get a copy of this message
You're using an alias of 'date' instead of DateOfOrder, so that should be reflected in the array key. So: $Date = $OrderDate["date"]; -Micah On Sun October 26 2003 4:22 pm, Graeme McLaren wrote: > Hey everyone, the following query and code works fine but I can't > understand why I can't echo the $Date variable. I guess it doesn't work > fine then :( > > Any ideas ? > > G :) > > $TheDate = mysql_query("select DATE_FORMAT(DateOfOrder, '%d, %m, %Y') as > date from Orders Where Orders.ID = '$TransID'"); > > while($OrderDate = mysql_fetch_array($TheDate)) > > { > > $Date = $OrderDate["DateOfOrder"]; > > }

« previous php.db (#31308) next »