sql issues with Membership System With Access Limitations

remedyremedy BeginnerLink Clerk
:cry: i have gone over and over this , its driving me crazy,.

Membership System With Access Limitations
Firstly you need to create a database. In this example we will call it MyDB.

Code:

CREATE DATABASE 'MyDB'



And here's the SQL for our 'members' table:



Code:

CREATE TABLE 'members' (
'id' INT(5) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
'member_id' VARCHAR(11) DEFAULT '000-000-000' NOT NULL ,
'name' VARCHAR(75) NOT NULL ,
'email' VARCHAR(50) NOT NULL ,
'username' VARCHAR (20) NOT NULL ,
'password' VARCHAR (15) NOT NULL ,
'date_signed' VARCHAR (10)  DEFAULT '00/00/0000' NOT NULL ,
'date_expire' VARCHAR (10) DEFAULT '00/00/0000' NOT NULL ,
PRIMARY KEY ('id') ,
INDEX ('date_signed' ,'date_expire') ,
UNIQUE ('member_id')
)
TYPE = MYISAM ;



That's done! Now let's make a form that would insert new members into the Database.

well....

ERROR 1064: your have an error in your SQL syntax. check the manual that corresponds to your MySql server version for this syntax to use near ''date_expire' VARCHAR (10) DEFAULT '00/00/0000' NOT NULL ,' at

help ! plz ! thanks :)

Comments

  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    Doesn't seem to be a problem with the table creation. Can you post the sql query that update the membership table when a new user is created?
  • PythonPython Forum Leader The Royal RAM
    hmm, im not too sure what thye problem is here. you see most of the tutorials on this site arent written by me, their sent in

    The Royal Ram

  • remedyremedy Beginner Link Clerk
    query was empty
  • remedyremedy Beginner Link Clerk
    useing phpmyadmin

    Error

    SQL-query :

    CREATE TABLE `members` (`id` INT(5) DEFAULT '0' NOT NULL AUTO_INCREMENT PRIMARY KEY) TYPE = MYISAM

    MySQL said:

    Invalid default value for 'id'
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    remedy, your posts are very confusing.... maybe you can present a coherent description of your problem...
  • remedyremedy Beginner Link Clerk
    sorry for the confussion, im learning MySQL in 48 hours, i more understand this now. Ok this is the query i got

    SQL-query :

    CREATE TABLE `mydb`.`members` (
    `id` int(5) unsigned NOT NULL auto_increment,
    `member_id` varchar(11) NOT NULL default '000-000-000',
    `name` varchar(75) NOT NULL default '',
    `email` varchar(50) NOT NULL default '',
    `username` varchar(20) NOT NULL default '',
    `password` varchar(15) NOT NULL default '',
    `date_signed` varchar(10) NOT NULL default '00/00/0000',
    `date_expire` varchar(10) NOT NULL default '00/00/0000',
    PRIMARY KEY (`id`),
    KEY `INDEX` (`date_signed`,`date_expire`),
    KEY `UNIQUE` (`member_id`)
    ) TYPE=MyISAM PACK_KEYS=1 CHECKSUM=1 ROW_FORMAT=DYNAMIC COMMENT='Database privileges'


    now after doing some slick addition to make this table this is what i got and its still does not work. dont know
  • remedyremedy Beginner Link Clerk
    weird, i check the user data in the database and it seems to be storeing the users but not authenticateing them

    http://www.wsupreme.com/members/bin/users.JPG

    im confussed now, as if i werent to begin with heh. any help would be great thanks :)
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    remedy,

    what doesn't work?

    1. when the create table query runs, are there any errors? is the table created?
    2. if there are no errors and the table is created, i'd assume then that you are complaining about retrieving or updating the table. if this is the case, no one can help you if you do not post the query that is used to retrieve or update the table!

    regards.
  • remedyremedy Beginner Link Clerk
    all set, thanks anyways, figured it out on my own, also was a php problem that was not found untill i perfected the table :) thanks again for dealing with me :p
  • freshwindesfreshwindes Beginner Link Clerk
    I am a new hand , see at will
Sign In or Register to comment.