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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.