FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


mySQL create table problem (parse error)..





ranzon
ok, when i'm trying to create an table in mySQL with this code:

Code:

<?php
include("db.php");
mysql_query("
CREATE TABLE `ønsker` ('
`id` INT (8) NOT NULL AUTO_INCREMENT,
`navn` VARCHAR (255) NOT NULL,
`hilsen` TEXT NOT NULL,
`ip` VARCHAR (255) NOT NULL,
`username` VARCHAR (255) NOT NULL,
ORIMARY KEY (`id`)
') TYPE = MYISAM
") or die(mysql_error());
?>


Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' `id` INT (8) NOT NULL AUTO_INCREMENT, `navn` VARCHAR (255) N


what can i do for fixing this?
LukeakaDanish
Are you sure a table is allowed to be called "ønsker"?

Im not sure the danish character ø is allowed in table names (though plz correct me if im wrong Wink )

Luke
ranzon
i still get the same error when i change "ø" to "o"..
BTW the letter is Norwegian.. Smile
ganbate
try this one :
Code:
<?php
include("db.php");
mysql_query("
CREATE TABLE `ønsker` (
`id` INT (8) NOT NULL AUTO_INCREMENT,
`navn` VARCHAR (255) NOT NULL,
`hilsen` TEXT NOT NULL,
`ip` VARCHAR (255) NOT NULL,
`username` VARCHAR (255) NOT NULL,
PRIMARY KEY (`id`)
) TYPE = MYISAM
") or die(mysql_error());
?>
ranzon
ganbate wrote:
try this one :
Code:
<?php
include("db.php");
mysql_query("
CREATE TABLE `ønsker` (
`id` INT (8) NOT NULL AUTO_INCREMENT,
`navn` VARCHAR (255) NOT NULL,
`hilsen` TEXT NOT NULL,
`ip` VARCHAR (255) NOT NULL,
`username` VARCHAR (255) NOT NULL,
PRIMARY KEY (`id`)
) TYPE = MYISAM
") or die(mysql_error());
?>


ohayeah.. that worked.. thank you!! Smile
Related topics
Defalut Value in MySql
mysql and apache problem.
Impossible parse error!
Trouble figuring out a parse error
Parse error: syntax error, unexpected '{' in /home/frih/publ
php error ?[parse error]
Parse error - need help
PHP Parse error on form handling - New to PHP
Parse error: syntax error, unexpected T_NEW
[PHP] Parse error
Parse Error in PHP I can't figure out.
Table problem
Cannot find parse error
what does constraint foreign key means when we create table
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.