MySQL语法错误><;


MySQL syntax 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 ' 'Andrew', 'West', '***@gmail.com',
'7*7 **', '', ' at line 14

使用的代码:

    $db_insert = mysql_query("INSERT INTO catches (
        catch_affid,
        catch_firstname,
        catch_lastname,
        catch_email,
        catch_street1,
        catch_street2,
        catch_city,
        catch_state,
        catch_postalcode,
        catch_country,
        catch_contactid
    ) VALUES (
        $a,
        '$f',
        '$l',
        '$e',
        '$s1',
        '$s2',
        '$c',
        '$s',
        $p,
        '$cy',
        '$cid'
    )");

如果没有看到字符串操作的实际最终结果(例如实际查询),我猜您的$a是空的:

   ... ) VALUES (,'Andrew', ...
                 ^---$a being blank

我猜$a的内容有问题。可能为NULL?