• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

query error

spork

New Member
i´m missing whats wrong with this query... it returns "You have an error in your SQL syntax near 'unsigned not null, group tinyint(2) default 0 unsigned not null, sec_level ' at line 22"

i just don´t see anything wrong about it... i tried running it without the columns style, group and sec_level and it worked fine, can´t figure out why though, they look fine to me...

style tinyint(2) default 0 unsigned not null,
group tinyint(2) default 0 unsigned not null,
sec_level tinyint(2) default 0 unsigned not null,

PHP:
<?php

include('dbconnect.php');

$result = mysql_query("create table users (
userid 		int(10) unsigned zerofill not null auto_increment,
username 	varchar(30) not null,
password 	varchar(20) not null,
joindate 	timestamp not null,
language 	tinyint(4) not null,
email 		varchar(255) null,
mes_aim 	varchar(255) null,
mes_msn 	varchar(255) null,
mes_icq 	int(10) null,
mes_yim 	varchar(255) null,
posts 		mediumint(9) not null,
started_threads mediumint(9) not null,
homepage 	varchar(255) null,
avatarid 	varchar(100) null,
use_avatar 	tinyint(1) default '0' null,
titlemotto 	varchar(75) null,
location 	varchar(100) null,
presentation 	text null,
birthday 	date null,
lastvisit 	timestamp null,
style 		tinyint(2) default 0 unsigned not null,
group 		tinyint(2) default 0 unsigned not null,
sec_level 	tinyint(2) default 0 unsigned not null,
timezone 	tinyint(2) default 0 not null,
showemail 	tinyint(1) default 0 null,
maillist 	tinyint(1) default 0 null,
recieveemail 	tinyint(1) default 0 null,
pm_recieve 	tinyint(1) default 0 null,
pm_popup 	tinyint(1) default 0 null,
pm_new 		smallint(5) unsigned zerofill default 0 not null,
pm_unread 	smallint(5) unsigned default 0 not null,
pm_last 	int(10) default 0 not null,
PRIMARY KEY 	(userid),
KEY name 	(username)
)") 
		or die (mysql_error());
?>
 
hehe, this sort of bugs me, i worked around the problem by inserting those 3 columns separately after the table was created... can´t figure out what the hell was wrong with them in the first place though...
 
Back
Top