Script Problem..!!! Werd noch wahnsinnig

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Script Problem..!!! Werd noch wahnsinnig

    Hallo liebe leute,

    ich hab ein kleines news-script erstellt, lokal mit mamp unter mac läuft alles tip top...
    kaum lade ich es hoch und lass es anzeigen im browser kommt mir der fehler an:

    Code:
    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
    
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /blaabla/php/show_yazi.php on line 31
    
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /blaabla/php/show_yazi.php on line 32
    
    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
    
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /blaabla/php/show_yazi.php on line 37

    Wenn ich jetzt mir die Zeilen 31, 32, 37 anschaue steht da dies, bzw. diese abfrage:

    Code:
    <?
    $query = mysql_query ("SELECT * FROM yazi WHERE id = $id");
    if (mysql_errno()) echo mysql_error ();
    [COLOR=red][B]Zeile 31:[/B][/COLOR]   $number = mysql_num_rows($query);
    [COLOR=red][B]Zeile 32:[/B][/COLOR]   $row = mysql_fetch_array($query);
    
    $kat_idsi = $row['kat_id'];
    $query2 = mysql_query("SELECT * from yazi_kat WHERE kat_id LIKE $kat_idsi");
    if (mysql_errno()) echo mysql_error ();
    [COLOR=red][B]Zeile 37:[/B][/COLOR]   $row2 = mysql_fetch_array($query2);
    
    $kat_idsi = $row['kat_id'];
    $query3 = mysql_query("SELECT * FROM yazi WHERE kat_id='$kat_idsi' ORDER BY id  DESC LIMIT 1,20");
    if (mysql_errno()) echo mysql_error ();
    ?>

    Ausgabe ist so: <?php echo $row['title']; ?> blablabla...

    Was mach ich da falsch? Ich such seit 2 tagen rum ich komm auf nichtss =((

    Kann mir jmd nen rat geben bitte.


    Ich benutze lokal die version 5 von php mysql ebenso...

    und aufm hoster ebenso...
    Zuletzt geändert von zero3; 13.12.2006, 03:13.

  • #2
    man bin ich blöd ...

    $id = $_GET["id"]; das hat gefehlt ... ouwww sorry leute für diesen sinnlosen beitrag jetzt :S:S:S

    Kommentar


    • #3
      $id = $_GET["id"]; das hat gefehlt ... ouwww sorry leute für diesen sinnlosen beitrag jetzt :S:S:S
      Und hättest du wie es hier in den Regeln steht mal ein
      PHP-Code:
      error_reporting(E_ALL); 
      gemacht, dann hätte php etwas von einer nicht initialisierten Var $id erzählt. Was sehr of auf Probs mit Register Globals hindeutet.

      Gruss

      tobi
      Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

      [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
      Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

      Kommentar

      Lädt...
      X