Wo habe ich den fehler!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wo habe ich den fehler!!

    Hallo All,

    Ich habe ein großere probleme mit mein PHP&mysql scripts. Ich kann gar nicht weiter kommen.Bitte hilfen Sie mir.

    die fehler sind,::


    The query is: INSERT into sizangx2003 values ('','','','')
    The query was successfully excuted!

    hier sind meine Scripts:

    //index.html
    PHP Code:
    <html>
    <
    head>
    <
    title>2002-2003 tan X Standard ong teng</title></head>
    <
    body>

    <
    div style="font-family:arial; text-align:center"><h2>
    </
    h2>
    Bitte f&uuml;llen Sie die Felder aus.  Vielen Dank!</div>
    <
    div style="font-family:arial">
    <
    form method="post" action="insert.php">
    <
    table border="0">
    <
    tr>
    <
    td>Min(Lia/Tg Type tu)</td>
    <
    td><input type=Text Name="Min"></td></tr>
    <
    br>
    <
    td>Pamin</td><br>
    <
    td><input type="text" name="Pamin"></td>
    <
    br>
    <
    td>Khuamin</td>
    <
    td><input type="text" name="Khuamin"></td>
    <
    br>
    <
    td>Distinction</td>
    <
    td><input type="text" name="Distinction"></td>
    <
    br>

    <
    td><input type="submit" value="Abschicken">
    <
    input type="reset" value="Löschen"></td></tr>
    </
    table>
    </
    form></div>
    </
    body></html
    //insert.php
    PHP Code:
    <?

    $host="localhost";
    $user="mysqltest";
    $pass="spider";
    $dbname="mysqltest";
    $tablename="sizangx2003";

    $link =mysql_connect ($host,$user,$pass);

    $query ="INSERT into $tablename values ('$Min','$Pamin','$Khuamin','$Distinction')";

    echo ("The query is:<br>$query<p>\n");
    if(mysql_db_query ($dbname,$query,$link))
    {
        echo("The query was successfully excuted!<br>\n");
    }
    else
    {
        echo("The query could not be excuted!<br>\n");
       
    }
    mysql_close($link);

    ?>
    //show.php

    PHP Code:
    <?PHP
    $db 
    mysql_connect("localhost","mysqltest","spider") or die("Problem connecting");
    mysql_select_db("mysqltest") or die("Problem selecting database");
    $query "SELECT * FROM sizangx2003 ORDER BY Min";
    $result mysql_query($query) or die ("Query failed");
    //let's get the number of rows in our result so we can use it in a for loop
    $numofrows mysql_num_rows($result);
    ?>
    <?PHP
    echo "<TABLE BORDER=\"1\">\n";
    echo 
    "<TR bgcolor=\"silver\"><TD>Name</TD><TD>Pamin</TD><TD>Khuamin</TD><TD>Distinction</TD></TR>\n";
    for(
    $i 0$i $numofrows$i++)
     {
        
    $row mysql_fetch_array($result); //get a row from our result set
        
    if($i 2//this means if there is a remainder

        
    {
          echo 
    "<TR bgcolor=\"white\">\n";
        }
        
         else

        { 
    //if there isn't a remainder we will do the else
            
    echo "<TR bgcolor=\"white\">\n";
        }
        
        echo 
    "<TD>".$row['Min']."</TD> <TD>".$row['Pamin']."</TD> <TD>".$row['Khuamin']."</TD> <TD>".$row['Distinction']."</TD>\n";
        echo 
    "</TR>\n";
    }
    //now let's close the table and be done with it
    echo "</TABLE>\n";
    ?>

    Ich danke Ihnen im Voraus;

    Zomi.


    EDIT:
    php.tags powered by Abraxax
    Last edited by Abraxax; 20-07-2003, 18:27.

  • #2
    es gibt php.tags, die auch du verwenden kannst, um den code besser darstellen zu können.

    ist das nicht ein widerspruch an sich?
    die fehler sind,:: vs. The query was successfully excuted!

    ich tippt aber eher darauf, dass du es als fehler interprtierst, weil keine daten in den feldern sind. oder?

    INSERT into sizangx2003 values ('','','','')

    und das wird an der einstellung der register_globals liegen. daher mache mal aus $Min einfach $_POST['Min'] usw. damit sollte es passen.

    PHP Code:
    $query "INSERT into ".$tablename." values ('".$_POST['Min']."','";
    $query.= $_POST['Pamin']."','".$_POST['Khuamin']."','".$_POST['Distinction']."')"
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Comment


    • #3
      Danke schön...

      Comment

      Working...
      X