Today I learned:
Connecting to MySQL with PHP
Check if a table exists and create it if not
This checks for a table called scorecard_test
and creates it if it doesn’t exist. The SQL parameters for the columns are:
- An integer called
ID
that is the primary key and auto increments
- A username that can’t be NULL
- A column called counter that has a default value of 1 if there is nothing passed, and the length can’t be longer than one digit
- A column that holds the current timestamp.