Unknown column __ in 'field set' part 2

    Date: 11/05/07 (PHP Community)    Keywords: php, mysql, sql

    ok, still banging my head against this one. Here's some more information.

    Output from PHP/MySQL on attempted insert:
    Error in query: INSERT INTO regTable (area) VALUES ('West_Coast'). Unknown column 'area' in 'field list'

    However, when I run that query on its own in the CLI or phpMyAdmin it works fine. It can be any valid column in that table and it still creates the same error.

    Here's the PHP/MySQL code, maybe the issue is with how I'm using the $_REQUEST array or concatenating the string for the query. In addition and just to eliminate possibilities I tried copying the output query from the script and putting it in as a static query in the same script and it works fine that way as well.

    Still at a loss.

    $query = "INSERT INTO regTable (area)
    VALUES
    ('".$_REQUEST['area']."')";

    // $query = "INSERT INTO regTable (area) VALUES ('West_Coast')";
    $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

    Source: http://community.livejournal.com/php/594655.html

« PHP/MySQL : Unknown column... || Removing a line wrap »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home