CodeChargeMVP
Posts: 473
|
| Posted: 11/17/2010, 1:59 AM |
|
Hello,
I´m in the middle of an asyncrone request to the php server,
somewhere in the php code, there´s an script where a
query is executed against database,
The script worked fine before by retrieve one field and one value
(I programmate my own dblookup function), but now I´ve to improve
the script cause the query returns one field, two or more values this way:
Field DivCod
Values USD
Values EUR
I´m thinking do a for,get the different values by the field and introduce
them on array and than return the array.
The for works fine, the first line is also ok, if echo $valor return the diferents
values for the field,but I don´t really know if the second line is good.
When I return the array and try to get access to the elements,
it ocurrs an error, ¿did I miss anything?
Please Focused on this peace of code.
for ($contador=0;$contador<$NumeroDeRegistros;$contador++)
{
$valor=@mysql_result($cursor1,$contador,$campo);
//echo $valor." ";
$valores[$contador] = array($valor);
}
return $valores;
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
|