SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot maxdream01's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question problem with mysql UPDATE query

    Hi everyone,
    Is there something wrong with this query? it will not update the table, even though all the variables are fine.
    PHP Code:
    mysql_query('UPDATE Blog 
        SET Title="$title", Post="$post" 
        WHERE id="$entry"'
    ); 
    thanks.
    PHP is FUN

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,496
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    Try switching the single and double quotes around.

  3. #3
    SitePoint Zealot maxdream01's Avatar
    Join Date
    Feb 2011
    Location
    USA
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks, i ended up doing that and just separating it like this:
    PHP Code:
    $updateQuery "UPDATE Blog 
        SET 
        Title = '
    $title',
        Post = '
    $post
        WHERE id = '
    $entry'";
        
    $update mysql_query($updateQuery$con); 
    and it worked.
    PHP is FUN


Tags for this Thread

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
  •