Re: [SMARTY] Re: Nested queries/nested arrays

From: Date: Mon, 15 Aug 2005 17:12:11 +0000
Subject: Re: [SMARTY] Re: Nested queries/nested arrays
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12966@lists.php.net to get a copy of this message
Matthew Weier O'Phinney wrote: >If you continue to have problems, you should probably create a dump of >the DB schema and then post a link to that and the PHP source you're >working with -- at this point, the suggestions myself and others have >made should give you something to work with, but there are many >assumptions we're having to make -- what DB abstraction layer you're >using, where files are located, etc. > > Thanks, everyone, for your help so far. I am no longer getting any errors, but I'm also not getting the data I expect, either. I'm not sure how to create a dump of the DB schema, but I did an export from mysql and have the file available: http://people.cgb.indiana.edu/ahemmeri/test/cgb_tmp.sql I have attached the .tpl and .php files I am using. As for where the files are located, index.php is at the top level and calls php code from /includes/code/welcome.php. The template files are in /templates/welcome/index.tpl. The problem I am having now is that I am not getting the information I thought I should have, which is an array of arrays with the project information with the projects that have sub-projects having an additional array of sub-project info. When I do print_r($projects), it prints out the array of project stuff, however, there is no sub-project array in the array. The two projects with sub projects have the same structure as those with no sub projects. Here is an example of two projects, one with a sub project, one without: Array ( [1] => (this one has no sub projects) Array ( [0] => CATPA [1] => Curation Analysis Tool for Protein Alignments [2] => [3] => As the genomes of more organisms become fully sequenced, there will be a greater opportunity to understand the function, structure, and evolution of genes. Typically, blah, blahblah. [4] => 34 [5] => ) (this one has a sub project) [14] => Array ( [0] => Regulatory Elements [1] => Regulatory Elements [2] => [3] => Transcriptional factors regulate gene expressions by binding to elements in DNA sequences. These regulatory elements are ofen short (about 4-15 nucleotides long), hidden in the background of nearly random DNA sequences, which make their identification difficult. blah, blahblah. [4] => 0 [5] => ) ) Looks like the structure is: [14] (project_id) => Array ( [0] => short_name [1] => title [2] =>short_description [3] => description [4] => file_id [5] => parent_project_cd) But there is nothing for subs. When I try to display the subs query, nothing appears, either.

« previous php.smarty.general (#12966) next »