Here is my query to create a table using mysql and php.
<?php
$con=mysql_connect("example.com","peter","abc123","my_db");
// Check connection
if (mysql_connect())
{
echo "Failed to connect to MySQL: " . mysql_error();
}
// Create table
$sql="CREATE TABLE student(Name CHAR(30),Email CHAR(30),Age INT,)";
// Execute query
if (mysql_query($con,$sql))
{
echo "Table persons created successfully";
}
else
{
echo "Error creating table: " . mysql_error($con);
}
?>
I am getting the Error as Check your Syntax
How can I resolve this error ?