If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Select multiple values from a single field mysql php my admin

Here is the thing. I am trying to create an oop php login form.There are 2 tables, users and applications where applications have 2 fields -> title [50 chars] -> active [boolean] in which I have set the title as primary key. By the other hand The users table construction is : id->primary key,name [50 chars],password [50 chars] and in the end the foreign key from applications ,title.

Also when I am tryinf for an example to select the user with 2 titls ,eg , a user with 2 applications and since I insert the data to the database I canot select it. When the other users with one title->application are displayed normally. SO my question is why I cannot display one user with 2 values as a title instead of user with one value.

You state that the 'users' table has a 'primary_key' field. Where in your select do you find the user with a certain primary key? You are just doing a join of user and applications with matching titles. Plus if you have users with multiple titles then you have multiple primary keys for that specific user.

If you can't explain it better perhaps you could show us 2-3 records from each table so we can see what you are doing.

Also - a 50 character key for a table is kinda big. Instead of a complex string field like that why do you not use a user-id value that links the two tables?

JGPS - If you're posting here you should be using:

error_reporting(E_ALL);
ini_set('display_errors', '1');
at the top of ALL php code while you develop it!

This one-to-many and possibly many-to-many relationship suggest to me that you need a 3rd "pivot" table between users and applications, which would just consist of the users primary key and the applications primary key as its two columns. Then you would join across it with something like