Jump to content

[SOLVED] MYSQL (references Users) does not work!


dch27

Recommended Posts

my web host is running MYSQL 3.23, 4.0, 4.1.  I don't know which. (godaddy)

 

They have a web gui that lets u create tables.  It also has an sql query window.

 

I have two tables.  members & users.  users has everybody that signs up for the sight, members are users that are affiliated.  I need a field in members to be called 'userID' and it needs to reference 'users'. 

 

how?

 

create table members ( userID not null references users ) does not work.  can i use triggers?  if so, how?

What I mean by doesn't work:

 

create table member (

memberID integer primary key,

userName not null references users,

);

 

#1064 - 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 'not null references users,

)' at line 3

 

 

I want the userName to be pulled out of the users table.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.