Re: Re: Another newbie question -- ANSWERED!!
| From: | randy | Date: | Tue, 07 Sep 2004 17:34:14 +0000 |
| Subject: | Re: Re: Another newbie question -- ANSWERED!! | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-36097@lists.php.net to get a copy of this message | ||
On Tue, 7 Sep 2004 13:16:20 -0400 (EDT), Pete Holsberg <pjh@mccc.edu> wrote:
> With a Unix shell programming background, I'm puzzled by
> the use of 'tics' (single quotes, apostrophes' around
> %$search_string%. I would have though that they would have
> removed the special meaning of the $.
Since you started the string with dbl quotes ($sql), any variables you
use in that string will work even if you wrap it in single quotes
(tics). If you use single quotes for the $sql string, you have to
'step out' of the string (or whatever you call it).
$sql = "SELECT * FROM $table"; // works
$sql = 'SELECT * FROM '.$table; // works
$sql = 'SELECT * FROM $table'; // doesn't work
randy
--
randy sesser@gmail.com