CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [RESOLVED] PIECE OF CODE (ARRAYS)

Print topic Send  topic

Author Message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.