Jump to content

Parse error creating table in DB


Pavlin24

Recommended Posts

Hallo. I need some help.

I am trying to create table in DB. It appears an error, and I can not find what is wrong.

 

Here is the code:

<?phpini_set('display_errors', 1);

error_reporting(E_ALL);

$con=msql_connect("localhost","pavlinan_db","mishon24");mysql_select_db("pavlinan_db");$sql="CREATE TABLE rabotna(id int not null auto_increment,col1,col2,col3,PRIMARY KEY(id));if(mysql_query($sql,$con)){echo "Таблицата е създадена успешно";}else{echo "Грешка при създаването на таблицата ".mysql_error($con);}?>

 

And here is the error message:

Parse error: in /home/pavlinan/public_html/upload/test.php on line 11

Link to comment
Share on other sites

it is php error not mysql. you have missed closing quote in $sql;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...