Jump to content

[SOLVED] OK Here is the problem I am having by following an earlier suggestion


Recommended Posts

I read the article about why not to use individual tables for each user. I understand why, gotcha, thanks. However what I need to do is not have duplicate entries, I need for at least my userid column to be unique.

I tried using this to validate but it is not working....

 

$sql_username_check = mysql_query("SELECT userid FROM User WHERE userid='$user_id'");

$username_check = mysql_num_rows($sql_username_check);

if ($username_check = 0) {

mysql_query("INSERT INTO User (userid, name)

VALUES ('$user_id', '<fb:name uid=\"$user_id\" useyou=\"false\" />')");

}

 

When I just use the mysql_query and none of the rest, everything works fine, but it keeps adding multiple entries.

 

comes with an output like this

 

776823045 Chuck Cagle

 

776823045 Chuck Cagle

 

See where that can be a problem when I attempt to pull information about the userid 776823045 its going to have 2 entries. All help greatly appreciated.

 

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.