Compare 2 List Of User Ids From Different Tables

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Compare 2 List Of User Ids From Different Tables

sonesay
Hi all. I am trying to make a list out of 2 list.

The first list is a complete list of users id from users table (List A)
The Second list is of users id from another table (List cool.gif

I want to subtrack the user ids in List B from List A and make List C.

Thanks in advance for any help smile.gif

Update: I looked up a old sql book i had and found some query examples. I tried the EXCEPT statement in mysql but it dont work so used another example.

CODE
SELECT userid, username
FROM users
WHERE userid NOT
IN (
SELECT ea_user_id
FROM events_attend
)


Good thing Mysql can do it I was dreading the idea of having to do this in php arrays.

Reply

Stenno
Your code is fine, but you could also do it this way:

CODE
SELECT * FROM `users`,  `events_attend` WHERE users.userid != events_attend.ea_user_id


I guess this has the same output

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. how to compare list of table - 8.48 hr back. (2)
  2. update data in different tables, php sql - 17.83 hr back. (1)
  3. code to compare two tables with different name - 36.09 hr back. (1)
  4. how to compare three table in php - 62.26 hr back. (1)
  5. one php search different tables - 76.39 hr back. (1)
  6. select user tables - 90.56 hr back. (1)
  7. php compare tables - 101.63 hr back. (1)
  8. compare 2 list - 104.30 hr back. (2)
  9. compare the different types of idss. - 233.33 hr back. (2)
  10. php compare 2 tables - 342.14 hr back. (1)
  11. select 2 tables from 2 different databases in php tutorial - 486.44 hr back. (1)
  12. lists of multiples of 2 tables - 497.87 hr back. (1)
  13. compare 2 tables php - 510.50 hr back. (2)
  14. mysql get list and query table based on list - 528.11 hr back. (1)
Similar Topics

Keywords : compare, 2, list, user, ids, tables

  1. Unexpected T_string In User.php [resolved]
    (5)
  2. Php Ftp Upload Form
    Adding User Directory to PHP Upload Form - Help (1)
    Alright I am trying to have a PHP FTP Upload Form that allows the user to create the directory
    folder for where they want to upload there files to. example: Main Directory: vainsoft.com There
    directory: vainsoft.com/modeling or vainsoft.com/photography But I dont want them to be able to
    upload things into the main directory, only sub-directories, is that possible with this coding that
    I have: //uses $_FILES global array //see manual for older PHP version info //This
    function will be used to get the extension from the filename function get_extension($fi....
  3. [mysql]get Id Of Loged In User?
    (7)
    how to get the id number of the loged in user? my db is id. username. password. i have tryed a
    few things.. but i never seem to get it right /ohmy.gif" style="vertical-align:middle" emoid=":o"
    border="0" alt="ohmy.gif" />....
  4. Multiple Drop Down Lists ?
    Multiple drop down lists to take user to new page (4)
    Hi everyone I was wondering if anyone could help. I want to create a page with multiple drop down
    lists and depending what the user selects decides the page they will be taken to. Sorry i havent
    explained this too well. Here is an example of what i want (link below) the user is also emailed a
    copy http://www.dermalogica.com/SpeedMappingOnl...US®ion=B I have searched the web and come
    close but nothing does it right I would be extremely greatful if anyone could help! Thanks ....
  5. Dynamically Select From 2 Tables Based On Id
    dynamically select from 2 tables based on id (1)
    hi there, im working on a performance request system, and i have three tables that im working with
    right now. the performances table holds the info about the performance (date, times, status, etc.),
    and has two columns, org_type and org_id, which both hold an int value to tell me where the
    organization info is. there are two org types which have respective tables, because we collect
    different information based on the type of org that is registering. is there any way to select info
    from all three tables (dynamically selecting between the two org tables based on org_type,....
  6. Directing To A User To Specific Page First Time Only
    (3)
    I make a signup page. I want that when someone signups and login for first time..then he is directed
    to the page X automatically. but after that it is redirected to Page Y always... Its pretty simple
    thing to do but im not understanding how i can make the script to identify that a person has logged
    in for first time ... anyhelp would be so welcome. Thanks.....
  7. Creatin Tables In Mysql
    (4)
    Hi everyone!
    I have a problem: when I create a table in MySQL,
    I'm asked to fill up some information about each colum.

    for example:
    | Name | Type | Value | 2nd Value | Attib....
  8. Problem To Join Tables In Database
    Problem in joining (many to many) relation (3)
    Please help me. I'm building a group of database fro a program. the situation is like this:
    'user' may have 1 or more class(es). 'class' itself may have 1 or more user in its
    classroom. I'm bad at explaining... maybe like this: A program is made to write data of
    classroom. Hikaru has a math class at Monday and statistic class at Tuesday. The math class itself
    consists of about 50 students in a classroom. So, Hikaru (user ) may have one or more class at
    time, math class (class) may have one or more students at time. So, basically I must mak....
  9. Script That Tracks The User Status
    how can I track on or offline users? (4)
    long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
    make a online/offline detector, but not totally sure. I know I can make a mysql database to track
    them, but how does it entrer the information? I could easily put in a field where when they login it
    sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
    short: I want someone to tell me how to make a online/offline status detector, like they have here
    on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr....
  10. Password Strength / User Availablity Scripts ?
    (2)
    many of u guys would already have noticed that now a days , on most of the websites , when some one
    sign in...as he puts his desired username in the textbox , the page shows that it is not available
    or it is available...without pushing any button etc.. and the second thing , when some one writes
    the password , on the same screen , it shows that password is weak or password is strong... i think
    it is done with php ... can some one give me a link to any page where i can access these scripts ?
    or some one can help me regarding this ?? Thanks for helping always.....
  11. An Sql Problem In Php
    returnin the name of the tables (1)
    hello again guys!, i was wondering if there is a way to get the table names from my database
    using php. Well what i want to do is to get the name of the tables returned as an array or something
    similar... thanx in advance....
  12. Cleaning User Input With Regex
    (1)
    As anyone who works with user input knows, not everyone who submits information makes it look
    proper. One one of my web forms, I parse all the needed fields that I wish to be title cased; their
    name, address, city, etc. I use this to perform this action, which works nicely: PHP Code: CODE
    $string = ucwords(strtolower($string)); This fixes the input if
    the user types in all caps or all lowercase. There is a problem I have been noticing about those who
    enter a generation after their name, such as "Bill Warner III". The above functio....
  13. User Login System With Setcookies
    (13)
    a friend of mine is quite good at php and told me not to use sessions and to use setcookie im not
    sure how to use setcookie to make a user authentication system and was wondering if anyone here know
    a tutorial on how to do it....
  14. Create A Windows User Account
    (1)
    hi, i am making an online registration scheme for my website for some webspace. i have got every
    thing sorted out exsept for one thing. to acces the ftp service and upload files to there user space
    i need to create a user account on the server for that user. is there a way to create a user account
    on a windows operating system with php 5 installed. thanks, kvarnerexpress ....
  15. Php Login Script
    Removing the login field once the user logs in (18)
    Hey everyone. I have a login script that i know works. My question is that on my main page, it have
    a form to allow the user to log in. What i want it to do is that once the user logs in, the form
    disappears and the users data (aka username) is displayed where the form was. At the moment i cant
    get it to work. Below is my code. CODE <div id="loginMenu">  <?php    if
    ($logged_in == 1)    {  ?>     <!-- User information -->  <?php
        }//if     else     {  ?>     <form action="<?php echo &....
  16. User Log-in
    PHP question (2)
    Hello all, I am a PHP n00b. I have read the Login page post, which is over my head. I was hoping
    someone could explain a concept to me more in layman's terms. This is what I hope to do - I want
    to go to my url (www.xyzblah.com) and have it automatically prompt for either a username and
    password, or just a password. After the correct credentials are supplied, go to the regular
    index.html. Any help you could give me is appreciated. Thanks.....

    1. Looking for compare, 2, list, user, ids, tables

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for compare, 2, list, user, ids, tables

*MORE FROM TRAP17.COM*
advertisement



Compare 2 List Of User Ids From Different Tables



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE