This topic is locked

A retrurn to the Labrador Pedigree Database

10/21/2007 12:52:32 PM
PHPRunner General questions
author

Greetings to all!!
My pedigree database has been up and running for awhile now. People are actually registering to use it and have not had any problems. There is a glitch though that I don't think they see.
In the beginning part of the view events page, I gather all the dogs's names like this:
//Get Sire 1

if (is_numeric($thisDogRow_value['SireID'])) {
$SireQ = $sql . $thisDogRow_value['SireID'];

$SireR = mysql_query ($SireQ);
$SireRow_value = mysql_fetch_array ($SireR, MYSQL_ASSOC);

$SireRow_value = array (

'RegName' => $SireRow_value['RegName'],

'SireID' => $SireRow_value['SireID'],

'DamID' => $SireRow_value['DamID'],

'Title' => $SireRow_value['Title'],

'Addl_Titles' => $SireRow_value['Addl_Titles']);
Then in the print section, the coding is like this:
//1

if (isset($SireRow_value['SireID']))

$message.="<tr><td valign=middle class=shade rowspan=16 colspan=1 width=150><small><small>".$SireRow_value['Title'].

"<a href=\"Pedigree_view.php?editid1=".$thisDogRow_value['SireID']."\">".$SireRow_value['RegName']."</b>

<br /><b>".$SireRow_value['Addl_Titles']."</b></small></small></td>";
else $message.="<td valign=middle class=shade rowspan=16 colspan=1 width=150><small><small>Sire</small></small></td>";
The print messages are in order of what they need to be so that the entries to the table are in the correct place, rather than in the order they are determined in the first section. I thought this would work because the values are determined first, before any printing is done, and I am asking for the 'values' instead of the formulas. But, it appears that the order of print does make a difference.
I created several 'test dogs' do make sure it was not an input error. Here's an example of the problem:
http://fortheloveoflabradors.com/labradors...p?editid1=31459
Note that the sire and dam for Test S. Mark on the first line of the Gr Grand Parents is correctly shown.
But on the 7th row down under Gr Gr Grandparents, the default values appear instead of the actual names as though the variable had not yet been determined.
Can anyone see where my logic is gone awry? this problems happens always in this scenario.
Thanks!!