PDO exec() creating table

Asked at 2017-01-11 04:12:22Z
  • 5 Subscribers

I am studying PDO with the example in w3schools.

The question I would like to ask is when I open the file (Click here for the code) on server, the browser shows

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'myguests' already exists

I double-checked if the table existed and also tried to create tables with different names but still show that message.

When I check on phpmyadmin, the tables are created successfully.

The code is one of the example from w3schools php database part.

Every examples lead to the same result.

Looks like it is executed twice for every query.

Anyone knows why? thanks!

0 answers in total

Answer this questsion