PHP SQL INSERT INTO statement not working directly after table creation

时间:2018-03-23 00:44:19

标签: php sql

I've been trying for an hour to get this to work and am at a loss at this point. This statement here is the issue. If I remove the INSERT INTO statement this works and the table is created, however when I add it back nothing happens. I've checked this is a valid SQL statement by performing directly on the DB and it works fine. Thanks for your help.

$conn->query("CREATE TABLE stock (Title varchar(255), Stock int(11)); INSERT 
INTO stock VALUES('Chair', 45);");

0 个答案:

没有答案