How do you insert a PHP constant into a SQL query?

前端 未结 4 2264
野性不改
野性不改 2020-12-18 05:34

I have a PHP file with my database configuration settings defined as constants, for example:



        
4条回答
  •  自闭症患者
    2020-12-18 05:39

    Just put it outside the quotes and it should work fine:

    $query = "SELECT users FROM ".DB_TABLE_1;
    

提交回复
热议问题