mysqli_query inputs via variable

后端 未结 3 1893
太阳男子
太阳男子 2021-01-28 06:00

I\'m trying to add information to a MySQL table using the following PHP code. (The input the name and text from an HTML5 basic web form.) Probably a syntax issue?



        
3条回答
  •  一向
    一向 (楼主)
    2021-01-28 06:16

       $sqlqr = 'INSERT INTO `ncool`.`coolbits_table` (`name`, `text`, `date`) VALUES ("'.$name.'", "'.$text.'", CURRENT_TIMESTAMP)';
    

    Keep your vars outside the quotes.

提交回复
热议问题