Aktív témák

  • A kód:

    Most nem dob notice-t!

    <?php
    $idf=mysql_connect(''localhost'',''root'',''netweb'');
    mysql_select_db(''blog'');

    if (isset($_GET['torles';]))
    {
    $torles=$_GET['torles';];
    if ($torles == ''yes'')
    {
    $torol=''DELETE FROM felhasznalo WHERE nick=$id'';
    $torol_le=mysql_query($torol) or die(mysql_error());
    }
    }
    if (isset($_GET['id';]))
    {
    $id=$_GET['id';];
    }



    $res=mysql_query(''select * from felhasznalo'');

    $nur=mysql_num_rows($res);

    print '<table width=100% border=3>' ;

    print '<tr>';
    print ''<td align=center>Nick</td>'';
    print ''<td align=center>Vnév</td>'';
    print ''<td align=center>Knév</td>'';
    print ''<td align=center>Email</td>'';
    print '</tr>';

    for($i=1; $i<=$nur; $i++)
    {
    $row=mysql_fetch_row($res);

    print '<tr>';
    print ''<td align=center>$row[0] </td>'';
    print ''<td align=center>$row[1] </td>'';
    print ''<td align=center>$row[2] </td>'';
    print ''<td align=center>$row[3] </td>'';
    print ''<td align=center><a href=felle.php?torles=yes&id=$row[0] target=main2>Törlés</a></td>'';
    print '<tr>';
    }
    print '</table>';
    mysql_close($idf);

    ?>


    Az eredmény, törlés gomb megnyomása után:

    Notice: Undefined variable: id in C:\Program Files\Apache Group\Apache2\htdocs\felle.php on line 10
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1


    PHP INI: [link]

    [Szerkesztve]

Aktív témák