CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Storing a result in array fails...

Print topic Send  topic

Author Message
orafrijoles

Posts: 4
Posted: 08/18/2005, 4:28 PM

Today I've trying long time with this, the problem is simple i'm just creating a connection object , executing a query and then trying to fetch the values and store them in arrays. This portion of code is located in 'Before Execute Select' event of a grid.

Here it is

  
  
// First declare my multiple array  
$table = array("clv" => array(),"equipos" => array(),"jj" => array(),  
	"jg" => array(),"je" => array(),"jp" => array(),"gf" => array(),"gc" => array(),  
	"puntos" => array());  
  
     // Create the connection  
	$equipos = new clsDBtrinca();  
  
   // SQL Statement  
	$sql_equipos = "SELECT equ_clv, equ_nombre ";   
	$sql_equipos .= "FROM grupos_soccer RIGHT JOIN equipos ON ";  
	$sql_equipos .= "equipos.gru_clv = grupos_soccer.gru_clv LEFT JOIN temp_actual ON ";  
	$sql_equipos .= "grupos_soccer.tmp_clv = temp_actual.tmp_clv WHERE temp_actual.tact_clv = 1";     
  
// Execute the query  
	$equipos->query($sql_equipos);  
	  
  // Grab the values and store in the array  
	while ($equipos->next_record()) {  
		array_push($table["clv"],$equipos->f["equ_clv"]);  
		array_push($table["equipos"],$equipos->f["equ_nombre"]);  
		echo $equipos->f["equ_nombre"]."<br>";  
	}  
	$equipos->close();  
  

I follow the same instructions matched on the user guide, and yet can't go on, i echo the values and nothing is printed on screen. I have more experience on PHP as raw coder and i don't understand why my code is not working. Do i have to use only your object model or something. Anyway i hope you can help me out.
_________________
Sable y machete
View profile  Send private message
peterr


Posts: 5971
Posted: 08/19/2005, 1:58 AM

I'm not too advanced with PHP but the 1st thing I'd do is to check if your event is executed at all. For example place echo "123"; at the beginning of the event to see if "123" will be displayed on the page. If the event works then you can you probably debug your code by placing additional echo statements within it.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Ganesan

Posts: 25
Posted: 08/19/2005, 2:11 AM

Hi,
Change $equipos->f["equ_clv"] to $equipos->f("equ_clv") and try.
View profile  Send private message
orafrijoles

Posts: 4
Posted: 08/19/2005, 11:27 AM

Thanks this resolve my problem, so sorry for my blindness.

Quote Ganesan:
Hi,
Change $equipos->f["equ_clv"] to $equipos->f("equ_clv") and try.

_________________
Sable y machete
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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