|
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
Navigation:
[Reply to this message]
|