php database insert not working according to plan

后端 未结 1 856
情话喂你
情话喂你 2021-01-17 03:55

This code is throwing an error i tried to troubleshoot but I\'m missing something . Since I wrote it I\'m overlooking a syntax error. Any help ?

$kql=\"
INS         


        
相关标签:
1条回答
  • 2021-01-17 04:03

    REFERENCES Is a SQL keyword used to define a foreign key.

    If you have a table/col named with a SQL keyword, you have to wrap the table/col name into specific characters.

    MySQL

    INSERT INTO `References` (...) ...
    

    MS SQL

    INSERT INTO [References] (...) ...
    

    Postgre SQL

    INSERT INTO "References" (...) ...
    

    I'm not sure concerning pgSQL, can someone confirm?


    In example, nothing (but common sense) prevents you from creating a database named INSERT with a table INTO having a column VALUE(42)

    This query works :

    USE [INSERT]
    SELECT [INTO].[VALUE(42)] FROM [INTO]
    
    0 讨论(0)
提交回复
热议问题