uhh, this is what I need to do: a basic
while($row = $db->fetch_array($query))
{
while(list($key,$value) = each($row))
{
$template .= str_replace("{".$key."}",$value,$dynamo);
}
}
I know that the column names (in this instance) will be TID & TEMPLATE_NAME, so I could take the easy way out and hard code those in there but I was hoping someone could offer a better solution. Here is my SQL:
$sql = "SELECT tid,template_name FROM TEMPLATE";
$query = $db->query($sql);
and here are the relevant DB funcs (these work fine):
function query($query_string)
{
$this->query_id = OCIParse($this->link_id,$query_string);
if(OCIExecute($this->query_id))
{
return $this->query_id;
}
else
{
$this->halt("Problematic SQL Statement");
}
}
// grab an array from result set
function fetch_array($query_id)
{
OCIFetchInto($query_id,&$result,OCI_ASSOC+OCI_RETURN_NULLS);
return $result;
}
What happens is this: it's making 2 passes, which makes sense. when I echo the template, outputs data for each row twice, once for each pass thru the 2nd while stmt. Can anyone advise? thanks in advance.