Re: Select Value with 's

From: Date: Thu, 06 Nov 2003 13:12:54 +0000
Subject: Re: Select Value with 's
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31473@lists.php.net to get a copy of this message
From: "pete M" <pmorgan@ukds.net> > > do not quite understand your problem.. pls post some code? > > heres a small snippet that should work well... > > > > $qry = 'SELECT customer FROM > > customerList ORDER BY > > customer'; > > $res = mysql_query($qry); > > while($customer = mysql_fetch_object($res)) { > > echo stripslashes($res->customer).'<br>'."\n"; > > } > > why the backticks and not quotes ????? Because quotes would make it a string. Backticks are used to deliminate column and table names. If you said: SELECT 'column' FROM Table You'd get a result set with the literal string "column" as the value. Works the same in the WHERE, ORDER BY, GROUP BY, etc clauses, also. ---John Holmes...

« previous php.db (#31473) next »