WHERE mit 3 spalten

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

  • WHERE mit 3 spalten

    Hi,

    ich hab echt nur Probs

    Also, ich möchte bei meiner Suchfunktion die auswahl von details ermöglichen.

    Also Suche in Beschreibung, Titel, Kommentar nach diesem Suchwort
    An und abwählbar durch jeweils eine Checkbox...

    Das Problem dabei ist nun, dass er diesen Code net akzeptiert:

    PHP Code:
        if ($check1=="genre" && $check2=="beschr" && $check3=="darsteller")
         {
          
    $sqlab "select * from tabelle_4 where movie_titel,$check1,$check2,$check3 LIKE '%$suche%'";
         } 
    Nach movie_titel soll immer gesucht werden...

  • #2
    hier findest du den korrekten syntax

    http://www.mysql.com/doc/de/SELECT.html

    deine abfrage wahr ja völlig falsch. hier mal eine korrektur, die zumindest vom syntax her stimmt. ich kenne ja deine felder nicht.

    PHP Code:
    if ($check1=="genre" && $check2=="beschr" && $check3=="darsteller")
    {
        
    $sqlab "select * from tabelle_4";
        
    $sqlab.= "where movie_titel LIKE '%".$suche".%' OR ";
        
    $sqlab.= "genre LIKE '%".$suche".%' OR ";
        
    $sqlab.= "beschr LIKE '%".$suche".%' OR ";
        
    $sqlab.= "darsteller LIKE '%".$suche".%'";

    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
      Hi,

      big thx...

      nun kommt aber folgender Fehler:

      Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\wampp2\htdocs\moviewelt\movie\search.php on line 65

      Linie 65: $sqlab.= "where movie_titel LIKE '%".$suche".%' OR ";

      Comment


      • #4
        prüf mal die syntax:
        PHP Code:
        $sqlab.= "where movie_titel LIKE '%".$suche".%' OR "// nix gut
        $sqlab.= "where movie_titel LIKE '%".$suche."%' OR "// is gut 
        Kissolino.com

        Comment


        • #5
          ähm... THX

          Comment


          • #6
            Original geschrieben von Wurzel
            prüf mal die syntax:
            hat sich etwa ein tippfehler eingeschlichen bei mir...
            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


            • #7
              unglaublich!

              Comment


              • #8
                @abrax geh die rente einreichen
                Beantworte nie Threads mit mehr als 15 followups...
                Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

                Comment


                • #9
                  ja. das rosa forumlar habe ich ja schon. in zwei jahren kann ich dann das blaue beantragen. und dann mal sehen...
                  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


                  • #10
                    alzheimer is everywhere ... man kann garnicht früh genug damit anfangen
                    Kissolino.com

                    Comment

                    Working...
                    X