• » webSPELL.org - Free Content Management System
  • Language switch: English German
  • login



    » lost password?   » register now
  • About webSPELL

    webSPELL is a free Content Management System which was especially developed for the needs of esport related communities. Since a short while we are also offering an optimized and enhanced webSPELL version for the special requirements of non-profit organisations. The purpose of both systems is to offer a professional and free opportunity to create and administrate your own website in an easy and optimized way.

    » Learn more about webSPELL     » Download webSPELL now!
  • Advertisement

    Follow us

  • Sort:     printview
    Author
    Message
    webSPELL user
    132 Posts
    02.09.2011, 14:59 offline quote 

    Oh i get it with update now...

    its SET col1 = msg, col2 = msg2

    Okay amüsiert
    Administrator
    Member of webSPELL e.V.
    2566 Posts
    02.09.2011, 14:57 email offline quote 

    There is just one "SET" allowed in a MySQL Query
    Code:
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    elseif ($edit == 'true' and isset($_GET['sliderID'])){
         $sliderID = $_GET['sliderID'];
         $name = $_POST['name'];
         $ds = mysql_fetch_array(safe_query('SELECT * FROM '.PREFIX.'slider WHERE id='.$sliderID.''));
         $sql = 'UPDATE '.PREFIX.'slider ';
         if ($name != $ds['name']) {
              $sql .= 'SET name="'.$name.'" ';
         }
         if ($_FILES['picture']['name'] != '') {
              $uploadDir = '../images/slider/';
              list($pictureName,$pictureFormat) = explode(".", $_FILES['picture']['name']);
              $uploadFile = $uploadDir.$sliderID.'.'.$pictureFormat;
             move_uploaded_file($_FILES['picture']['tmp_name'], $uploadFile);
              $sql .= 'SET picture_format = "'.$pictureFormat.'" ';
         }
           
         $checkbox = $_POST['displayed'];
         foreach ($checkbox as $check){
              $checkbox = $check;
         }
         $num = mysql_num_rows(safe_query('SELECT * FROM '.PREFIX.'slider WHERE display = 1'));
         if ($num < 5 and $checkbox == 'show' or $checkbox != 'show') {
              if ($checkbox == 'show') $sql .= ',display =  1 ';
              else $sql .= ',display =  0 ';
              
              $sql .= 'WHERE id='.$sliderID.'';
              echo $sql;
              safe_query($sql);
              redirect('admincenter.php?site=slider', ''.$_language->module['success_edit'].'',1);
         } else {
              redirect('admincenter.php?site=slider', ''.$_language->module['error_check'].'',4);
         }
    }


    But i think there are more mistakes in the code zunge raus
    webSPELL user
    132 Posts
    02.09.2011, 14:52 offline quote 

    Here is my Error:

    Code:
    1.
    2.
    3.
    errorno=1064
    error=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 'SET display = 1 WHERE id=2' at line 1
    query=UPDATE ws_c94_slider SET picture_format = png SET display = 1 WHERE id=2


    Here is my Code:

    Code:
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    elseif ($edit == 'true' and isset($_GET['sliderID'])){
         $sliderID = $_GET['sliderID'];
         $name = $_POST['name'];
         $ds = mysql_fetch_array(safe_query('SELECT * FROM '.PREFIX.'slider WHERE id='.$sliderID.''));
         $sql = 'UPDATE '.PREFIX.'slider ';
         if ($name != $ds['name']) {
              $sql .= 'SET name="'.$name.'" ';
         }
         if ($_FILES['picture']['name'] != '') {
              $uploadDir = '../images/slider/';
              list($pictureName,$pictureFormat) = explode(".", $_FILES['picture']['name']);
              $uploadFile = $uploadDir.$sliderID.'.'.$pictureFormat;
             move_uploaded_file($_FILES['picture']['tmp_name'], $uploadFile);
              $sql .= 'SET picture_format = '.$pictureFormat.' ';
         }
           
         $checkbox = $_POST['displayed'];
         foreach ($checkbox as $check){
              $checkbox = $check;
         }
         $num = mysql_num_rows(safe_query('SELECT * FROM '.PREFIX.'slider WHERE display = 1'));
         if ($num < 5 and $checkbox == 'show' or $checkbox != 'show') {
              if ($checkbox == 'show') $sql .= 'SET display =  1 ';
              else $sql .= 'SET display =  0 ';
              
              $sql .= 'WHERE id='.$sliderID.'';
              echo $sql;
              safe_query($sql);
              redirect('admincenter.php?site=slider', ''.$_language->module['success_edit'].'',1);
         } else {
              redirect('admincenter.php?site=slider', ''.$_language->module['error_check'].'',4);
         }
    }


    Query failed, dont know what is the Problem here.
    Sort:     printview


    To start or to reply to a topic you have to be registered and logged in!

    register now
    login
  • » Support

    » Topics
    24.05.2013 - 22:25 - 6 Replies
    » Ändern der Größe php
    Ändern der Größe php
    Last post: andy5116
    Board: DE - Allgemeiner Support
    24.05.2013 - 22:25
    24.05.2013 - 15:12 - 19 Replies
    » forum anzeige erweitern
    forum anzeige erweitern
    Last post: Swordfish3000
    Board: DE - Allgemeiner Support
    24.05.2013 - 15:12
    24.05.2013 - 12:03 - 1 Replies
    » Verkaufe prof. Clandesign
    Verkaufe prof. Clandesign
    Last post: Vith3r
    Board: DE - Biete
    24.05.2013 - 12:03
    24.05.2013 - 12:02 - 6 Replies
    » [S] Team/Clan Logos (Upda...
    [S] Team/Clan Logos (Update: 2 new Logos)
    Last post: a--w
    Board: EN - Offers
    24.05.2013 - 12:02
    24.05.2013 - 02:41 - 17 Replies
    » High Quality Website
    High Quality Website
    Last post: Dansjostedt
    Board: EN - Offers
    24.05.2013 - 02:41
    24.05.2013 - 02:24 - 5 Replies
    » [SELL] Gaming Website
    [SELL] Gaming Website
    Last post: hornyst
    Board: EN - Offers
    24.05.2013 - 02:24
    23.05.2013 - 22:37 - 2 Replies
    » Bilder Breite im Forum an...
    Bilder Breite im Forum anpassen
    Last post: nappel.ger
    Board: DE - Vorschläge
    23.05.2013 - 22:37
    23.05.2013 - 15:35 - 6 Replies
    » I cannot upload template ...
    I cannot upload template to my cms .
    Last post: bazic
    Board: EN - General
    23.05.2013 - 15:35
    23.05.2013 - 14:50 - 3 Replies
    » Kalendar-Box
    Kalendar-Box
    Last post: kassor
    Board: DE - Anfragen
    23.05.2013 - 14:50
    23.05.2013 - 10:14 - 12 Replies
    » Mein Forum
    Mein Forum
    Last post: Lordy4007
    Board: DE - Fragen zur Seite
    23.05.2013 - 10:14
    22.05.2013 - 23:06 - 9 Replies
    » When the update?
    When the update?
    Last post: kola60
    Board: EN - General
    22.05.2013 - 23:06
    22.05.2013 - 22:21 - 2 Replies
    » Website For SALE! CODED
    Website For SALE! CODED
    Last post: Osamakillz
    Board: EN - General
    22.05.2013 - 22:21
    22.05.2013 - 21:43 - 3 Replies
    » Slider Links Bitte um Hil...
    Slider Links Bitte um Hilfe
    Last post: bazic
    Board: DE - Allgemein
    22.05.2013 - 21:43
    22.05.2013 - 21:28 - 464 Replies
    » Wettscript 2.1 for 4.2.3a...
    Wettscript 2.1 for 4.2.3a - Betscript
    Last post: Amokossi
    Board: DE - Fertige Skripte
    22.05.2013 - 21:28
    22.05.2013 - 17:46 - 3 Replies
    » Admin login
    Admin login
    Last post: blackmoonstah
    Board: DE - Allgemeiner Support
    22.05.2013 - 17:46
    22.05.2013 - 17:28 - 1 Replies
    » Design Ausverkauf - alles...
    Design Ausverkauf - alles unter 70€
    Last post: Freestyler92
    Board: DE - Biete
    22.05.2013 - 17:28
    22.05.2013 - 14:54 - 2 Replies
    » adminlogin auf allypage f...
    adminlogin auf allypage funktioniert nicht mehr. bitte um hilfe
    Last post: blackmoonstah
    Board: DE - Technischer Support
    22.05.2013 - 14:54
    22.05.2013 - 14:41 - 4 Replies
    » Content laden
    Content laden
    Last post: bazic
    Board: DE - Anfragen
    22.05.2013 - 14:41
    22.05.2013 - 09:57 - 0 Replies
    » [4SALE] eSport Design/Tem...
    [4SALE] eSport Design/Template
    Last post: LeG3nDz
    Board: EN - Offers
    22.05.2013 - 09:57
    22.05.2013 - 09:24 - 1 Replies
    » Updatefunktion?
    Updatefunktion?
    Last post: Sysix
    Board: DE - Vorschläge
    22.05.2013 - 09:24
    » Partners
    Bilderkiste.org Image Hosting
    k3rmit.org
    PascalMh.de


    » Blog
    28.03.2013 - derchris
    » Those damn spammers