Avatar billede jammerlab Nybegynder
14. september 2002 - 20:07 Der er 3 kommentarer og
1 løsning

Find lige min fejl :) table probs

Dau dau... er rimlig n00b til php og jeg kan ikke lige få styr på mit script... når man trykker på "rapport" så rykker den rundt på lortet meningen er at den nye table skal dukke frem forneden. Her er scriptet:

        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
                <tr>
                <td width=20% class=wares><span class=normaltextfed>&nbsp; Modstander</span></td>
                <td width=15% class=wares><span class=normaltextfed>Cup</span></td>
                <td width=20% class=wares><span class=normaltextfed>Dato</span></td>
                <td width=15% class=wares><span class=normaltextfed>Antal</span></td>
                <td width=15% class=wares><span class=normaltextfed>Result</span></td>
                <td width=15% class=wares><span class=normaltextfed>&nbsp; </span></td>
                </tr></table>
<?
$getpcws = mysql_query("SELECT id,modstander,type,dato,antal,score,rapport FROM pcw ORDER BY id DESC");
while($pcws=mysql_fetch_array($getpcws)) {
echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center>
                <tr>
                <td width=20%><span class=normaltext>&nbsp; $pcws[modstander]</span></td>
                <td width=15%><span class=normaltext>$pcws[type]</span></td>
                <td width=20%><span class=normaltext>$pcws[dato]</span></td>
                <td width=15%><span class=normaltext>$pcws[antal]</span></td>
                <td width=15%><span class=normaltext>$pcws[score]</span></td>
                <td width=15%><span class=normaltext><a href='wares_include.php?rapport=$pcws[id]'>Rapporten</span></a></td>
                  </tr></table>
";

if ($rapport == $pcws[id]) {
        echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
        <tr>
        <td width=20% class=wares><span class=normaltextfed>&nbsp; Rapport</span></td>
        </tr>
        <tr>
                <td width=100%><span class=normaltext>&nbsp; $pcws[rapport] </span></td>
        </tr>
        </table>
"; }
}
?>

Den kan også ses på http://www.jammerlab.dk/amici/test/wares_include.php
Avatar billede whatever Nybegynder
14. september 2002 - 20:37 #1
Det skyldes jo klart nok, at din "rapport" står indenfor while-sætningen. Så kommer den jo under det valgte punkt.
Avatar billede whatever Nybegynder
14. september 2002 - 20:39 #2
Prøv dette:

        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
                <tr>
                <td width=20% class=wares><span class=normaltextfed>&nbsp; Modstander</span></td>
                <td width=15% class=wares><span class=normaltextfed>Cup</span></td>
                <td width=20% class=wares><span class=normaltextfed>Dato</span></td>
                <td width=15% class=wares><span class=normaltextfed>Antal</span></td>
                <td width=15% class=wares><span class=normaltextfed>Result</span></td>
                <td width=15% class=wares><span class=normaltextfed>&nbsp; </span></td>
                </tr></table>
<?
$getpcws = mysql_query("SELECT id,modstander,type,dato,antal,score,rapport FROM pcw ORDER BY id DESC");
while($pcws=mysql_fetch_array($getpcws)) {
echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center>
                <tr>
                <td width=20%><span class=normaltext>&nbsp; $pcws[modstander]</span></td>
                <td width=15%><span class=normaltext>$pcws[type]</span></td>
                <td width=20%><span class=normaltext>$pcws[dato]</span></td>
                <td width=15%><span class=normaltext>$pcws[antal]</span></td>
                <td width=15%><span class=normaltext>$pcws[score]</span></td>
                <td width=15%><span class=normaltext><a href='wares_include.php?rapport=$pcws[id]'>Rapporten</span></a></td>
                  </tr></table>
";

if ($rapport == $pcws[id]) {
  $pcws_rapport = $pcws[rapport];
}

if ($pcws_rapport) {
        echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
        <tr>
        <td width=20% class=wares><span class=normaltextfed>&nbsp; Rapport</span></td>
        </tr>
        <tr>
                <td width=100%><span class=normaltext>&nbsp; $pcws_rapport </span></td>
        </tr>
        </table>
"; }

?>
Avatar billede whatever Nybegynder
14. september 2002 - 20:40 #3
der er sneget en fejl ind, så prøv denne istedet:

        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
                <tr>
                <td width=20% class=wares><span class=normaltextfed>&nbsp; Modstander</span></td>
                <td width=15% class=wares><span class=normaltextfed>Cup</span></td>
                <td width=20% class=wares><span class=normaltextfed>Dato</span></td>
                <td width=15% class=wares><span class=normaltextfed>Antal</span></td>
                <td width=15% class=wares><span class=normaltextfed>Result</span></td>
                <td width=15% class=wares><span class=normaltextfed>&nbsp; </span></td>
                </tr></table>
<?
$getpcws = mysql_query("SELECT id,modstander,type,dato,antal,score,rapport FROM pcw ORDER BY id DESC");
while($pcws=mysql_fetch_array($getpcws)) {
echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center>
                <tr>
                <td width=20%><span class=normaltext>&nbsp; $pcws[modstander]</span></td>
                <td width=15%><span class=normaltext>$pcws[type]</span></td>
                <td width=20%><span class=normaltext>$pcws[dato]</span></td>
                <td width=15%><span class=normaltext>$pcws[antal]</span></td>
                <td width=15%><span class=normaltext>$pcws[score]</span></td>
                <td width=15%><span class=normaltext><a href='wares_include.php?rapport=$pcws[id]'>Rapporten</span></a></td>
                  </tr></table>
";
if ($rapport == $pcws[id]) {
  $pcws_rapport = $pcws[rapport];
}
}
if ($pcws_rapport) {
        echo "
        <table width=400 border=0 cellspacing=0 cellpadding=0 align=center class=menu>
        <tr>
        <td width=20% class=wares><span class=normaltextfed>&nbsp; Rapport</span></td>
        </tr>
        <tr>
                <td width=100%><span class=normaltext>&nbsp; $pcws_rapport </span></td>
        </tr>
        </table>
"; }

?>
Avatar billede jammerlab Nybegynder
14. september 2002 - 20:44 #4
lavede det helt om så det kom til at se okay ud... erhm... du for bare de points... tak for hjælpen ;)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester