Here is my code. But it is showing error while creating table tblStudents every time. Why is that? Need a solution as soon as possible.
<?php
$con=mysqli_connect("localhost","root","noor.xbyte","fathis_quran_class");
if (mysqli_connect_errno()) {
echo '<h1>Error Connecting to the database!</h1>';
} else {
$sql = "CREATE TABLE tblStudents
(
index INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(index),
fullName CHAR(30) NOT NULL,
dateOfBirth DATE NOT NULL,
SID TINYINT NOT NULL,
address CHAR(30) NOT NULL,
level TINYINT NOT NULL,)";
if (mysqli_query($con,$sql)) {
echo 'Table "tblStudents" created successfully!';
} else {
echo 'Error creating table "tblStudents"';
}
}
?>;