quotes/private

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi list!

I have a php5-related problem I think.
I do a sql query and retrieve an array.

$resultTask = mysql_query("select * from dbTask where taskId=$taskId") or die("erreur recup task".mysql_error());
while( $row_resultTask = mysql_fetch_array($resultTask ) )
{
$ownerId=$row_resultTask[ownerID];
$private=$row_resultTask[private];
}


Under my current php version no problem.(4.3.2)

I tried it under php5 and the line $private=$row_resultTask[private]; throws me an error (unexpected T_VARIABLE).
Modifying the line :
$private=$row_resultTask["private"];
or
$private=$row_resultTask['private'];


solves the problem.

My question is :
1/ the normal syntax into the brackets: with ", ' or nothing? I think it should be "" but I'm unsure.
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? any idea where I could find a list?


Thanks a lot,
Melanie

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends http://www.msn.co.uk/messenger


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux