Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save everaldomatias/c94c47cba9812a33dc2200d852adfa36 to your computer and use it in GitHub Desktop.
Save everaldomatias/c94c47cba9812a33dc2200d852adfa36 to your computer and use it in GitHub Desktop.
Cria tabela caso não exista
// Cria a tabela Configuracoes se não existir
$conexao_configuracoes = mysqli_connect( $host, $user, $pass, $banco ) or die( "ERROR : " . mysqli_error() );
$configuracoes = "configuracoes";
$cria_configuracoes = $conexao_configuracoes->query("CREATE TABLE IF NOT EXISTS $configuracoes(
ID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY(ID),
km_inicial VARCHAR(50) NOT NULL,
data_inicial DATE NOT NULL,
valor_compra VARCHAR(50) NOT NULL
)");
mysqli_close( $conexao_configuracoes );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment