RE: [PHP-DB] quotes/private
| From: | Rob Agar | Date: | Thu, 17 Mar 2005 02:07:49 +0000 |
| Subject: | RE: [PHP-DB] quotes/private | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38937@lists.php.net to get a copy of this message | ||
hi Melanie
> From: mel list_php [mailto:list_php@hotmail.co.uk]
> My question is :
> 1/ the normal syntax into the brackets: with ", ' or nothing?
> I think it
> should be "" but I'm unsure.
Single quotes, but check out http://au2.php.net/types.string for details
why :)
> 2/it's working with other words wihtout the quotes (eg
> $ownerId=$row_resultTask[ownerID];)
> is it because private is a reserved word or something?
yep. PHP interprets any word it doesn't recognise as a constant, which
is why
it worked before.
if you do this
<?php
error_reporting(E_ALL | E_STRICT);
echo something_not_defined;
?>
You'll get this:
Notice: Use of undefined constant something_not_defined - assumed
'something_not_defined'
but if you change something_not_defined to a reserved word like private,
you'll get a parse error as you found.
> any
> idea where I
> could find a list?
I don't know about a list as such, but http://www.php.net/manual/en/
will help.
Rob