Reply to recursive function calling by reference

Your name:

Reply:


Posted by Stephanie Le Gall on 04/05/06 12:47

Hello,


I'm using a recursive function to get an array of ID from a database passing
the array by reference.

I need this structure for the function because the database structure is
like a tree and there is no limit of level.

Here is the code :

____________________________________________________
function remplir_tableau($id, &$arrayOfAllElem)
{
$arrayOfAllElem[] = $id;
$req_ksup = mysql_query("select kinf_ksup,nume_kard,soci_kard
from kardex_superieur
left join kardex on id_kard=kinf_ksup
where ksup_ksup='$id' ");

while ($row = mysql_fetch_array($req_ksup, MYSQL_NUM))
{
remplir_tableau($row[0], &$arrayOfAllElem);
}
}


remplir_tableau($id_kard, $TabKard);
_____________________________________________________




but if I don't change the php.ini file allow_call_time_pass_reference to
true I have a message :

Warning: Call-time pass-by-reference has been deprecated - argument passed
by value; If you would like to pass it by reference, modify the declaration
of [runtime function name](). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true in
your INI file. However, future versions may not support this any longer.


I have the error message but the function seems to work anyway !


Is there any way else to do that ? ... or to not have the message ?


Thanks a lot for helping !



Stιphanie

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация