Thanks very much for the support. I'll try to explain myself a bit better.
Say we have this query:
$Query=mysql_query("SELECT a,b,c FROM d", $Connection);
So, i want 3 fields, but each field will return more than one result.
So i can do this following things:
A) Return 3 unidimensional arrays (i CAN'T do that from a function) containing the results. Functions can only have ONE return instruction (or so i think)
😎 Return 1 bidimensional array and then cut it into 3 unidimensional arrays.
C) Create a STRUCT with three arrays in it and make the function return that.
D) Create a data-only class, whose properties would be three arrays, and return it from the function.
E) Pass the three unidimensional arrays by reference and make the function modify them.
I don't know how to do the pass C, D, or E.
That is what i wanted someone to explain me.
And about the deprecation of reference passing, when i used &$whatever as an argument for a function, it gave me back a warning saying that passing by reference will soon be deprecated.
Maybe i have to declare the function like this:
function A(&$whatever){
.........
}
But i have ANOTHER problem. If i declare ONE argument as an agument passed by reference to the function, how can i declare more than one dynamically?
I'll explain this:
$Query=mysql_query("SELECT a,b,c FROM d", $Connection);
So i know i need three arrays.
I could declare the function like this:
function A(&$field_1, &$field_2, &$field_3){
............
}
where $field_1, $field_2, and $field_3 would be the arrays that would contain the results from the query.
But, if say i need FOUR arrays, how can i make the function declaration so it knows how many arguments i'm going to pass?
Maybe using some global PHP variable?
That is my problem.
Excuse my bad english, but i am spanish and this is not my native language.
And thanks very much for your support.
fLIPIS