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, &$arrayOfAllEle m)
{
$arrayOfAllElem[] = $id;
$req_ksup = mysql_query("se lect kinf_ksup,nume_ kard,soci_kard
from kardex_superieu r
left join kardex on id_kard=kinf_ks up
where ksup_ksup='$id' ");
while ($row = mysql_fetch_arr ay($req_ksup, MYSQL_NUM))
{
remplir_tableau ($row[0], &$arrayOfAllEle m);
}
}
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
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, &$arrayOfAllEle m)
{
$arrayOfAllElem[] = $id;
$req_ksup = mysql_query("se lect kinf_ksup,nume_ kard,soci_kard
from kardex_superieu r
left join kardex on id_kard=kinf_ks up
where ksup_ksup='$id' ");
while ($row = mysql_fetch_arr ay($req_ksup, MYSQL_NUM))
{
remplir_tableau ($row[0], &$arrayOfAllEle m);
}
}
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
Comment