Flo: Update tabelle.... dringend Hilfe!

$sorting_del  =  "update fahrzeuge set sortid=".($sortid-1)."  where sortid>'$delsortid' AND typ='$typ' AND marke='$marke'";

$result = mysql_query($sorting_del,$serverid);

  1. mein Problem fehlt natürlich noch!

    $sorting_del  =  "update fahrzeuge set sortid=".($sortid-1)."  where sortid>'$delsortid' AND typ='$typ' AND marke='$marke'";

    +++++++++++++++++++++++++++++++++++
    ++sortid++++marke+++++++++typ++++++
    ++++1++++++Kawasaki++++Motorrad++++
    ++++2++++++Kawasaki++++Motorrad++++
    ++++3++++++Kawasaki++++Motorrad++++
    ++++4++++++Kawasaki++++Motorrad++++
    ++++5++++++Kawasaki++++Motorrad++++
    ++++6++++++Kawasaki++++Motorrad++++

    wenn ich jetzt nummer 3 lösche, dann soll der rest nachrücken. also

    4 -> 3
    5 -> 4
    6 -> 5

    im Moment wird alles > delsortid:

    4 -> 3
    5 -> 3
    6 -> 3

    Danke

    1. Hallo Flo .... fehlt was

      $sorting_del  =  "update fahrzeuge set sortid=".($sortid-1)."  where sortid>'$delsortid' AND typ='$typ' AND marke='$marke'";

      Gib mal an dieser Stelle den Inhalt Deines SQL-Statements per echo aus, und Du wirst sehen und staunen:

      update fahrzeuge set sortid=3 where sortid>3 and typ='motorrad' and marke='Kawasaki'

      Statt dessen:

      $sorting_del  =  "update fahrzeuge set sortid = sortid - 1 where sortid > '$delsortid' AND typ='$typ' AND marke='$marke'";

      sollte eher das tun, was Du erwartest.

      Danke

      Freundliche Grüsse,

      Vinzenz

      1. vielen Dank! Geht!!!