Results 1 to 3 of 3

Thread: sql statement help

  1. #1
    Join Date
    Jul 2005
    Posts
    30

    Default sql statement help

    I'm working on a new glossary addon and have hit a road block. What is wrong with the sql statement below (table glossary is correct, field gloss_term is correct and the variables are correct and will "$display .=" properly to the screen... so something is wrong with my sql statement.

    $sql = 'UPDATE '.$config['table_prefix'].'glossary SET gloss_term = \'$_POST['term']\' WHERE gloss_id = \'$gloss_id\'';

    I keep getting a parse error no matter what I try... help
    Mark
    -----------------------------------------------
    I've come to paint but forgot my brush, got beer?

  2. #2
    the_sandking's Avatar
    the_sandking is offline hadron remnant - Moderation Fachmann
    Join Date
    Apr 2003
    Location
    Nullspace
    Posts
    5,289

    Default

    Perhaps this:

    Code:
     $sql = "UPDATE ".$config['table_prefix']."glossary 
    SET gloss_term = ' ".$_POST['term']." '
    WHERE gloss_id =' ".$gloss_id." ' ";
    "Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-BS communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy."

    "We gotta' go to the crappy town where I'm a hero!"
    -Hoban 'Wash' Washburne 2485-2519


    "When you’re born you get a ticket to the freak show. When you’re born in America, you get a front-row seat.."
    -George Carlin 1937-2008

    New to Open-Realty® and need help? Check the:
    -OR DOCUMENTATION -

    Important: Read this at least once in your lifetime
    How To Ask Questions The Smart Way

  3. #3
    Join Date
    Jul 2005
    Posts
    30

    Default

    thanks for the help, I got it with this:

    $sql = "UPDATE ".$config['table_prefix']."glossary SET gloss_term='".$gloss_term."' , gloss_definition='".$gloss_definition."' WHERE gloss_id ='".$gloss_id."' ";

    php can sometimes be a f^(#!ng p@!n !n the @$$
    Mark
    -----------------------------------------------
    I've come to paint but forgot my brush, got beer?

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
  •