quotes/private

From: Date: Wed, 16 Mar 2005 10:46:16 +0000
Subject: quotes/private
Groups: php.db 
Request: Send a blank email to php-db+get-38927@lists.php.net to get a copy of this message
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

« previous php.db (#38927) next »