0

I have written these codes (if table doesn't exist) condition. The Database is fine however my table is not creating and there was not error. Can anyone help me?!

   $connect=mysqli_connect($host,$username,$password)or die("cannot connect");

$create=mysqli_query($connect,"CREATE DATABASE IF NOT EXISTS projectdb") or die (mysql_error());
mysqli_select_db($connect,"projectdb");

$info="CREATE TABLE IF NOT EXISTS info (
    id int NOT NULL auto_increment,
    contactEmail text NOT NULL,
    firstName varchar(50) NOT NULL,
    lastName varchar(50) NOT NULL,
    phone varchar(50) NOT NULL,
    phone text NOT NULL,
    dob date NOT NULL,
    address varchar(50) NOT NULL,
    country varchar(70) NOT NULL,  
    PRIMARY KEY(id),
    UNIQUE KEY ( id )
    )";

mysqli_query($connect,$info);
Hardy Rust
  • 1,600
  • 1
  • 10
  • 12

1 Answers1

0

your phone column is duplicate. so use any one

phone varchar(50) NOT NULL,
phone text NOT NULL,

Please use bellow :

phone varchar(50) NOT NULL,

or

phone text NOT NULL,
Razib Al Mamun
  • 2,663
  • 1
  • 16
  • 24