Jump to content

Problem with displaying final value (all others display, so i'm confused)


Chezshire

Recommended Posts

Hi to one and all!

  I think my problem is simple, but I'm not sure hence i'm turning to any freaks willing to help a newb. Any and all help is greatly appreciated!  :D

 

I have a game site for RP purposes, players build characters with stats (values I believe is the term) which are entered in the form which is handled by a database and the the values are pulled from the database and displayed when someone looks up that character. Everything is working correctly except for the last value (Power Rank).

 

Expected Result: Someone selects the desired ranks/scores for their character via pulldown menus in the character creation form, and then when someone else wants to check their scores/ranks, the character's bio is displayed featuring all their scores and ranks. The character's Classification, Skill Level, Resources, Tech Level all display, as do their scores for Fighting, agility, strength, endurance, reason, intuition, and psyche. However the final stat/score 'Power Rank' remains blank.

 

I.E. Player selects 'amazing' as a value/score, that value displays in the character's bio on the site.

Here is an example of a character bio: http://www.xpg.us/cerebra/display.php?id=567 If you scroll down to the middle of the form, you'll see the final entry under 'character stats' which is power rank is blank. It should be displaying the value of amazing (Which is in the database but as said not caring over)

 

I've looked in the database and the value is their, but its' carrying over like everything is and i can't figure out why. Any help would be, as said above, greatly appreciated!

 

 

This is the overall code to the section in question (This is a snippet of the 1407 lines, so i've narrowed it down, but can't figure out where in these thirty or so lines the actual problem is)

 

<?php
if (!$classificationName) { $classificationsDB="0"; }
if (!$skilllevel) { $skilllevel="0"; }
if (!$resourceLevels) { $$resources="0"; }
if (!$techLevels) { $tech="0"; }
if (!$statLevels) { $powerrankDB="0"; }


echo "<tr><td align=\"right\" valign=\"top\"><p><b>Classification:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $classificationName[$classificationsDB] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Skill Level:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $skillLevels[$skilllevel] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Resources:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $resourceLevels[$resources] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Tech Level:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $techLevels[$tech] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Power Rank:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $statLevels[$powerrankDB] . "</p></td></tr>\n";


echo "<p><b><a href=http://www.xpg.us/rules/fighting.php TARGET=_blank> FI:</a></b> " . $statLevels[$fightingDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/agility.php TARGET=_blank> Ag:</a></b> " . $statLevels[$agilityDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/strength.php TARGET=_blank> Str:</a></b> " . $statLevels[$strengthDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/endurance.php TARGET=_blank> End:</a></b> " . $statLevels[$enduranceDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/reason.php TARGET=_blank> Rea:</a></b> " . $statLevels[$reasonDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/intelligence.php TARGET=_blank> Int:</a></b> " . $statLevels[$intuitionDB] . "&#32;<font color=#172434> &#124; </font> &#32;\n";
echo "<b><a href=http://www.xpg.us/rules/psyche.php TARGET=_blank> Psy:</a></b> " . $statLevels[$psycheDB] . "</br>\n";
?>
</table>

 

Please help me, i'm obviously dumb (I'm also dyslexic) Any help is appreciated. Thank you.

- Chez

 

P.S. What is 'regex'? I've heard people speak of it, but i don't actually know what it is, or if i do know I don't know that I know. Like I said before, i'm a completely self-taught newbie. Any and all help is appreciated.

 

what would this output:

<?php
if (!$classificationName) { 
$classificationsDB="0"; 
}
if (!$skilllevel) { 
$skilllevel="0"; 
}
if (!$resourceLevels) { 
$resources="0"; 
}
if (!$techLevels) { 
$tech="0"; 
}
if (!$statLevels) { 
$powerrankDB="0"; 
}


echo "<tr><td align=\"right\" valign=\"top\"><p><b>Classification:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $classificationName[$classificationsDB] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Skill Level:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $skillLevels[$skilllevel] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Resources:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $resourceLevels[$resources] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Tech Level:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" . $techLevels[$tech] . "</p></td></tr>\n";

echo "<tr><td align=\"right\" valign=\"top\"><p><b>Power Rank:</b></p></td>\n";
echo "<td width=\"10\"> </td><td valign=\"top\"><p>" .$powerrankDB . "</p></td></tr>\n";


echo "<p><b><a href=http://www.xpg.us/rules/fighting.php TARGET=_blank> FI:</a></b> " . $statLevels[$fightingDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/agility.php TARGET=_blank> Ag:</a></b> " . $statLevels[$agilityDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/strength.php TARGET=_blank> Str:</a></b> " . $statLevels[$strengthDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/endurance.php TARGET=_blank> End:</a></b> " . $statLevels[$enduranceDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/reason.php TARGET=_blank> Rea:</a></b> " . $statLevels[$reasonDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/intelligence.php TARGET=_blank> Int:</a></b> " . $statLevels[$intuitionDB] . "&#38;#32;<font color=#172434> &#38;#124; </font> &#38;#32;\n";
echo "<b><a href=http://www.xpg.us/rules/psyche.php TARGET=_blank> Psy:</a></b> " . $statLevels[$psycheDB] . "</br>\n";
?>
</table>

?

I posted the code you suggested and got the following result:

 

Parse error: parse error, unexpected T_STRING in /home/content/z/a/n/zanland/html/xpg/cerebra/displayTest2.php on line 221 (My friend Zan is letting me test my stuff on his server)

 

Line #221 is:

 

if (!$classificationName) { 

 

http://www.xpg.us/cerebra/displayTest2.php?id=567

 

 

P.S. Thank you for the initial assistance. I'm trying to understand what your code test does now and how it works as I can certainly learn something from it! I still don't understand what I've done or how to fix it necessarily, but I'm thinking that maybe it has something to do with an unexpected T_String. I'm not sure what that is exactly either. But i'm googling away and will check back here soon.

 

Thank you thank you thank you!

 

Hmmms,

 

By variables, do you mean what i have in my functions (the arrays there?) or would it be the fields/array like this

$fields = array("codename", "name", "identitystatus", "formeraliases", "nickname", "height", "weight", "hair", "eyes", "ethnicity", "dateofbirth", "age", "educationDB", "gender", "orientation", "characteristics", "baseofoperations", "affiliation", "formeraffiliation", "type", "concept", "occupation", "formeroccupation", "legalstatus", "maritalstatus", "citizenship", "placeofbirth", "appearance", "quote", "modelname", "waiver", "song", "song_link", "squadronDB", "fightingDB", "agilityDB", "enduranceDB", "strengthDB", "reasonDB", "intuitionDB", "psycheDB", "classificationsDB",  "physicalpowers", "mentalpowers", "powersource", "skilllevel", "weaknesses", "skills", "fightingskills", "resources", "tech", "relatives", "contacts", "enemies", "costume", "equipment", "transportation", "demeanor", "nature", "personality", "goals", "history", "room", "advisor", "mentor", "tutor", "schoolclubs");

 

$fieldNames = array("Codename", "Name", "Identity Status", "Former Aliases", "Nickname", "Height", "Weight", "Hair", "Eyes", "Ethnicity", "Birthdate", "Age", "Education", "Gender", "Orientation", "Characteristics", "Base of Operations", "Affiliation", "Former Affiliation", "Type", "Character Concept", "Occupation", "Former Occupation", "Legal Status", "Marital Status", "Citizenship", "Hometown", "Appearance", "Quote", "Model", "Waiver",  "Song", "Song Link", "Training Squadron", "Fighting", "Agility", "Endurance", "Strength", "Reason", "Intuition", "Psyche", "Classifications",  "Advantages", "Powers", "Power Source","Skills", "Disadvantages", "Skills", "Fighting Skills", "Resources", "Tech", "Relatives", "Contacts", "Enemies", "Costume", "Equipment", "Transportation", "Demeanor", "Nature", "Personality", "Goals", "History", "Room", "Advisor", "Mentor", "Tutor", "School Clubs");

 

 

Sorry -- I'm not familiar with any of the actual terms. I've just been figuring stuff out as I go (very embarrassed by this). I can send you my submit code (edit.php) file which people enter their data, or the full display.php if you want. I'm just not sure what you need to see.

 

I'm very thankful for any help you can provide. I help people who know less then I, which isn't a lot but when I can I do. And I seldom ask until I know i've exhausted myself (i only discovered forums like a week ago)

 

Thanks regardless, just for the time you've given me

-Chez

 

 

I guess what I mean is this:

where do you get the data to compare against in this code:

if (!$classificationName) { $classificationsDB="0"; }
if (!$skilllevel) { $skilllevel="0"; }
if (!$resourceLevels) { $$resources="0"; }
if (!$techLevels) { $tech="0"; }
if (!$statLevels) { $powerrankDB="0"; }

Hi,

 

i think that i understand what your asking now (that the variables are the information which is to ultimately be displayed in the character bio. I.E. The information which is entered in the character application and passed on to the database and then from the database to the displayed character bio).

 

If so then this is the specific code in question that your asking for.

 

== $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>]

<tr>

<td width="30%" align="right" valign="top"><p>RANK - Power Rank:</p></td>

<td colspan="2" valign="top"><SELECT name="POWERRANKDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["powerrankDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

Or if you want to see the info in the database, here is a screenshot:

www.xpg.us/Database.jpg

 

Here is the full snippet of that section should you need it for reference:

 

== $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>Skill Level:<br>

<span class='fineprint'>An individual's overall mastery of their mutations based on training and/or innate skill.</span></p></td>

<td colspan="2" valign="top"><SELECT name="SKILLLEVEL">

<?php $i=0;

FOREACH ($skillLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["skilllevel"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>FI - Fighting:<br>

<span class='fineprint'>The character's overall combat effectiveness<br>

For Details,<br><a href="http://www.xpg.us/rules/fighting.php" TARGET=_blank>

> CLICK HERE</a></p></td>

<td colspan="2" valign="top"><SELECT name="FIGHTINGDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["fightingDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>AG - Agility:<br>

<span class='fineprint'>The character's overall dexterity<br>

For Details,<br><a href="http://www.xpg.us/rules/agility.php" TARGET=_blank>

> CLICK HERE</a></p></td>

<td colspan="2" valign="top"><SELECT name="AGILITYDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["agilityDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>STR - Strength:<br>

<span class='fineprint'>The character's overall physical prowse<br>

For Details,<br><a href="http://www.xpg.us/rules/strength.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="STRENGTHDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["strengthDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>END - Endurance:<br>

<span class='fineprint'>The character's overall durability<br>

For Details,<br><a href="http://www.xpg.us/rules/endurance.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="ENDURANCEDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["enduranceDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>REA - Reason:<br>

<span class='fineprint'>The character's overall knowledge<br>

For Details,<br><a href="http://www.xpg.us/rules/reason.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="REASONDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["reasonDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>INT - Intuition:<br>

<span class='fineprint'>The character's deductive abilities<br>For Details,<br>

<a href="http://www.xpg.us/rules/intuition.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="INTUITIONDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["intuitionDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>PSY - Psyche:<br>

<span class='fineprint'>The character's overall mental durability<br>

For Details,<br><a href="http://www.xpg.us/rules/psyche.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="PSYCHEDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["psycheDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>RE - Resources:</p></td>

<td colspan="2" valign="top"><SELECT name="RESOURCES">

<?php

$i=0;

FOREACH ($resourceLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["resources"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>Tech Level:</p></td>

<td colspan="2" valign="top"><SELECT name="TECH">

<?php

$i=0;

FOREACH ($techLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["tech"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>RANK - Power Rank:</p></td>

<td colspan="2" valign="top"><SELECT name="POWERRANKDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["powerrankDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>]

<!-- ======== Character STATs ======== -->

 

 

<table border="0" cellpadding="6" cellspacing="0" width="95%">

<tr> <td colspan="3" align="center"><h2>Character STATs</h2>

<hr color="#050F1D" size="5"></td></tr>

 

 

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>Mutant Classification:<br>

<span class='fineprint'>Overall potential level of mutant powers, regardless of training.</span></p>

</td>

<td colspan="2" valign="top">

<SELECT name="CLASSIFICATIONSDB">

<?php

$i=0;

FOREACH ($classificationName as $thisLevel) {

echo "<option value='$i'";

if ($record["classificationsDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>Skill Level:<br>

<span class='fineprint'>An individual's overall mastery of their mutations based on training and/or innate skill.</span></p></td>

<td colspan="2" valign="top"><SELECT name="SKILLLEVEL">

<?php $i=0;

FOREACH ($skillLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["skilllevel"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>FI - Fighting:<br>

<span class='fineprint'>The character's overall combat effectiveness<br>

For Details,<br><a href="http://www.xpg.us/rules/fighting.php" TARGET=_blank>

> CLICK HERE</a></p></td>

<td colspan="2" valign="top"><SELECT name="FIGHTINGDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["fightingDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>AG - Agility:<br>

<span class='fineprint'>The character's overall dexterity<br>

For Details,<br><a href="http://www.xpg.us/rules/agility.php" TARGET=_blank>

> CLICK HERE</a></p></td>

<td colspan="2" valign="top"><SELECT name="AGILITYDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["agilityDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>STR - Strength:<br>

<span class='fineprint'>The character's overall physical prowse<br>

For Details,<br><a href="http://www.xpg.us/rules/strength.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="STRENGTHDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["strengthDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>END - Endurance:<br>

<span class='fineprint'>The character's overall durability<br>

For Details,<br><a href="http://www.xpg.us/rules/endurance.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="ENDURANCEDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["enduranceDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>REA - Reason:<br>

<span class='fineprint'>The character's overall knowledge<br>

For Details,<br><a href="http://www.xpg.us/rules/reason.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="REASONDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["reasonDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>INT - Intuition:<br>

<span class='fineprint'>The character's deductive abilities<br>For Details,<br>

<a href="http://www.xpg.us/rules/intuition.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="INTUITIONDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["intuitionDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>PSY - Psyche:<br>

<span class='fineprint'>The character's overall mental durability<br>

For Details,<br><a href="http://www.xpg.us/rules/psyche.php" TARGET=_blank>

> CLICK HERE</a></p></td></span></p></td>

<td colspan="2" valign="top"><SELECT name="PSYCHEDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["psycheDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

<tr>

<td width="30%" align="right" valign="top"><p>RE - Resources:</p></td>

<td colspan="2" valign="top"><SELECT name="RESOURCES">

<?php

$i=0;

FOREACH ($resourceLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["resources"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>Tech Level:</p></td>

<td colspan="2" valign="top"><SELECT name="TECH">

<?php

$i=0;

FOREACH ($techLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["tech"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

<tr>

<td width="30%" align="right" valign="top"><p>RANK - Power Rank:</p></td>

<td colspan="2" valign="top"><SELECT name="POWERRANKDB">

<?php

$i=0;

FOREACH ($statLevels as $thisLevel) {

echo "<option value='$i'";

if ($record["powerrankDB"] == $i) { echo " selected"; }

echo ">$thisLevel</option>\n";

$i++;

} // end FOREACH

?></select></td></tr>

 

 

 

As always thank you. Sincerely and appreciatively. Thank you.

 

 

Problem solved -- I didn't load the initial database name into my PHP at the beginning of the page. So my code where I thought the bug was was correct, but i didn't note it in my '$fields = array' and '$fieldNames = array' so of course that one didn't work but the others did.

 

Thanks for the help!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.