Ankündigung

Einklappen
Keine Ankündigung bisher.

Vergleich mit or klappt nicht richtig

Einklappen

Neue Werbung 2019

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

  • Vergleich mit or klappt nicht richtig

    Hallo zusammen ich habe da leider ein Verständnis Problem

    Also ich möchte wenn die aktuelle Session leer ist und eine der Category _IDs vorhanden ist das "DB Abfrage Eins" ausgeführt wird,
    das klappt auch prima.

    Wenn man sich jetzt aber anmeldet und die die Session nicht mehr leer ist springt das Script nur bei der ersten category_id auf die zweite Abfrage
    und bei den anderen bleibt es bei der ersten Abfrage. Ich versteh nicht was da los ist. Bin leider kein PHP Profi wie man sieht. Was mache ich falsch

    PHP-Code:
    if (
        empty(
    $_SESSION['customer_id']) &&
         (
    $current_category_id == '737') ||
         (
    $current_category_id == '738') ||
         (
    $current_category_id == '739') ||
         (
    $current_category_id == '741') || 
         (
    $current_category_id == '743') ||
         (
    $current_category_id == '728') ||
         (
    $current_category_id == '729') ||
         (
    $current_category_id == '727') ||
         (
    $current_category_id == '730') ||
         (
    $current_category_id == '734') ||
         (
    $current_category_id == '733') ||
         (
    $current_category_id == '731')

     {
                
    $listing_sql "DB Abfrage Eins"            
     

     else {
             
    $listing_sql "DB Afrage 2;"
     


    Vielen Dank Andy

  • #2
    Ganz grundlegende Gesetzmäßigkeit der Aussagenlogik: UND bindet stärker als ODER.

    Setze sinnvoll Klammern.
    [SIZE="1"]RGB is totally confusing - I mean, at least #C0FFEE should be brown, right?[/SIZE]

    Kommentar


    • #3
      Stimme zu:

      PHP-Code:
      if (
          empty(
      $_SESSION['customer_id']) &&
           ((
      $current_category_id == '737') ||
           (
      $current_category_id == '738') ||
           (
      $current_category_id == '739') ||
           (
      $current_category_id == '741') || 
           (
      $current_category_id == '743') ||
           (
      $current_category_id == '728') ||
           (
      $current_category_id == '729') ||
           (
      $current_category_id == '727') ||
           (
      $current_category_id == '730') ||
           (
      $current_category_id == '734') ||
           (
      $current_category_id == '733') ||
           (
      $current_category_id == '731'))

       {
                  
      $listing_sql "DB Abfrage Eins"            
       

       else {
               
      $listing_sql "DB Afrage 2;"
       

      MfG
      ~Capfly

      Kommentar


      • #4
        sorry habs gesehen teste das gleich mal


        Klappt prima vielen Dank und ich suche wie verrueckt vielen Dank !

        Kommentar


        • #5
          Deine Bedingung ist, dass customer_id leer ist und die id gleich 737 ist!

          So, das war die erste Bedingung!!

          Die zweite wäre, dass: oder NUR die id gleich 738 ist !!
          MfG
          ~Capfly

          Kommentar

          Lädt...
          X