SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    victoria
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help me with this query

    PHP Code:
    $dates $_POST['date'];
        
    $descriptions $_POST['description'];
        
    $contents $_POST['content'];
        
    $names $_POST['name'];
        
    $logos $_POST['logo'];
        
    $categorys $_POST['category'];
        
    $datesub addslashes($dates);
        
    $descriptionsub addslashes($descriptions);
        
    $contentsub addslashes($contents);
        
    $namesub addslashes($names);
        
    $logosub addslashes($logos);
        
    $categorysub addslashes($categorys);
        
    $idsub addslashes($_POST['id']);
        
    $link_query "
        UPDATE articles
        SET date = '
    $datesub',
        SET description = '
    $descriptionsub',
        SET content = '
    $contentsub',
        SET name = '
    $namesub',
        SET logo = '
    $logosub',
        SET category = '
    $categorysub'
        WHERE id = 
    $idsub;
        "

    the query failed to run.

    date is a date field, content is a text field, all else is varchar

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    there should be only one SET keyword
    Code:
    update articles
       set date = '$datesub'
         , description = '$descriptionsub'
         , content = '$contentsub'
         , name = '$namesub'
         , logo = '$logosub'
         , category = '$categorysub'
     where id = $idsub
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    victoria
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you <3

    Got it, thanks all

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SET date = '$datesub'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •