[php]Find den Fehler nicht

10/17/2012 20:08 inter55545#1
Hallo leute hab hier mal was geschieben aber iwie klappt das nicht

Fehlermeldung :

/n"; } ?>
Spells
Name Cost Type Attribute
".$itemsrow["name"]". ".$itemsrow["mp"]." $type ".$itemsrow["attribute"]."


Code:


<table width="50%" style="border: solid 0px black" cellspacing="0" cellpadding="0">
<tr><td colspan="8" bgcolor="transparent"><center><b>Spells</b></center></td></tr>
<tr><td><b>Name</b></td><td><b>Cost</b></td><td><b>Type</b></td><td><b>Attribute</b></td></tr>
<?
$count = 1;
$itemsquery = doquery("SELECT * FROM {{table}} ORDER BY id", "spells");
while ($itemsrow = mysql_fetch_array($itemsquery)) {
if ($count == 1) { $color = "bgcolor=\"transparent\""; $count = 2; } else { $color = ""; $count = 1; }
if ($itemsrow["type"] == 1) { $type = "Heal"; }
elseif ($itemsrow["type"] == 2) { $type = "Hurt"; }
elseif ($itemsrow["type"] == 3) { $type = "Sleep"; }
elseif ($itemsrow["type"] == 4) { $type = "+Damage (%)"; }
elseif ($itemsrow["type"] == 5) { $type = "+Defense (%)"; }
echo "<tr><td $color width=\"25%\">".$itemsrow["name"]".</td><td $color width=\"25%\">".$itemsrow["mp"]."</td><td $color width=\"25%\">$type</td><td $color width=\"25%\">".$itemsrow["attribute"]."</td></tr>/n";


Es sollte mir aus der DB mit name dk_spells die teile auflisten

nach 4 std. suche frag ich wo hab ich mich verschieben seh ich den wald vor lauter bäume nicht mehr?
10/17/2012 20:24 NotEnoughForYou#2
ich habe lediglich deine syntaxfehler beseitigt, ob der restliche Code Sinn ergibt habe ich nicht geschaut.

PHP Code:
<table width="50%" style="border: solid 0px black" cellspacing="0" cellpadding="0">
<tr><td colspan="8" bgcolor="transparent"><center><b>Spells</b></center></td></tr>
<tr><td><b>Name</b></td><td><b>Cost</b></td><td><b>Type</b></td><td><b>Attribute</b></td></tr>
<?
$count 
1;
$itemsquery doquery("SELECT * FROM {{table}} ORDER BY id""spells");
while (
$itemsrow mysql_fetch_array($itemsquery)) {
if (
$count == 1) { $color "bgcolor=\"transparent\""$count 2; } else { $color ""$count 1; }
if (
$itemsrow["type"] == 1) { $type "Heal"; }
elseif (
$itemsrow["type"] == 2) { $type "Hurt"; }
elseif (
$itemsrow["type"] == 3) { $type "Sleep"; }
elseif (
$itemsrow["type"] == 4) { $type "+Damage (%)"; }
elseif (
$itemsrow["type"] == 5) { $type "+Defense (%)"; }

echo 
'<tr><td '.$color.' width ="25%">'.$itemrow['name'].'</td><td '.$color.' width ="25%">'.$itemrow['mp'].'</td><td '.$color.' width="25">'.$type.'</td><td '.$color.' width="25">'.$itemrow['attribute'].'</td></tr>\n';

}
?>
10/17/2012 20:28 boxxiebabee#3
Was sollt {{table}} sein? Falls das ne Variable ist muss es so heißen: {$table}
10/17/2012 20:52 inter55545#4
Danke für die schnelle hilfe aber
keine hat geholfen ich schau auch weiter mit
aber nach insgesammt 10 std. for pc sollte ich wohl mal ne pause machen :D

kann geschlossen werden hab den fehler gefunden mit hilfe von neuronet

<? wollte er nicht musste <?php schreiben