NameSilo

[Resolved] Database help needed asap!!!

Spaceship Spaceship
Watch

tez30

Established Member
Impact
1
database help needed asap!!!

i'm catch hell with this tables(my first time working with them)
when i test my registration for my site i get's this error

Error in checking :Table 'playstat_ps2t.users' doesn't exist


so i opened cpanel and opened phpmyadmin to create my tables then i got this error

Error
SQL query:

CREATE TABLE `members` (

`username` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL AUTO_INCREMENT ,
`password` VARCHAR( 16 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`first_name` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`last_name` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`address` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`city` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`state` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`interested_game` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`email_address` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`phone_number` INT( 11 ) NOT NULL ,
`age` INT( 2 ) NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci COMMENT = 'registration for ps2-tournament'

MySQL said:

#1063 - Incorrect column specifier for column 'username'

can anybody please help me out?
thanks in advance.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
you have username field set to text and you can't auto increment a text field. I believe thats what the error is telling you.
 
0
•••
Table 'playstat_ps2t.users' doesn't exist

Have you created a table which is named users , in database playstat_ps2t ?
 
0
•••
know i'm getting this error:

Error in registering user : .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 '[email protected]','334-749-3616',0,'%2007-%11-%15 %09-%45-%02','s.c.a#',0,'28ae' at line 1
 
0
•••
can you show us the full SQL you are trying to execute.
 
0
•••
this is the sql i'm triing to execute:

Field Type - Collation ---- Attributes ---- Null --- Default --- Extra Action
username - text ---- utf8_unicode_ci -- No
password - varchar(16) - utf8_unicode_ci -- No
first_name - text -------- utf8_unicode_ci -- No
last_name - text -------- utf8_unicode_ci -- No
address --- text -------- utf8_unicode_ci -- No
city ------- text -------- utf8_unicode_ci -- No
state ----- text --------- utf8_unicode_ci -- No
interested_game - text -- utf8_unicode_ci -- No
email_address - text ---- utf8_unicode_ci -- No
phone_number - int(11) -- -- No
age ------ int(2) -------- -- No

can anybody tell me what i'm doing wrong?
 
0
•••
that isnt the sql you are trying to execute that looks more like a copy of the table structure.
 
0
•••
okay had a quick look and it looks to me like you are trying to enclose $game in single quotes for the SQL but you did not close them

Change

PHP:
$qry = mysql_query("insert into users(affid,username,password,fname,lname,address, city,state,game,paypalemailaddress,phone,credits,d ateapplied,notify,active,confirmcode) ".
" values(".$affid.",'".$uname."','".$pwd."','".$fname."','".$lname."','".$address."','".$city."','".$state."','".$game.
",'".$email."','".$ph."',".$credits.",'".date('%Y-%m-%d %H-%i-%s')."','".$game."#',0,'".$code."')") or die("Error in registering user : $username .".mysql_error());

Too

PHP:
$qry = mysql_query("insert into users(affid,username,password,fname,lname,address, city,state,game,paypalemailaddress,phone,credits,d ateapplied,notify,active,confirmcode) ".
" values(".$affid.",'".$uname."','".$pwd."','".$fname."','".$lname."','".$address."','".$city."','".$state."','".$game.
"','".$email."','".$ph."',".$credits.",'".date('%Y-%m-%d %H-%i-%s')."','".$game."#',0,'".$code."')") or die("Error in registering user : $username .".mysql_error());
 
0
•••
now i'm gettin this error:

Error in registering user : .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 'ateapplied,notify,active,confirmcode) values(0,'test','12345','joe','horn'' at line 1

do i have to have a field for all of these?
 
Last edited:
0
•••
Yes there has to be a filed which correspond to each of those within the users table
 
0
•••
thanks alot peter@flexiwebhost, i fixed it :)
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back