-1

I have two tables and I must select some records and put it in xls by using PHP script.

I'm try different query but not working.

On JOD_users table i need to select id, name, username, email and on JOD_user_profiles i need to select profile_key and profile_value but the profile_value are in the same column (this is my problem).

tables structure

How can I have the result in a single row?

Thanks a lot.

2 Answers2

0

You can do a INNER JOIN query like this:

SELECT user.*, profile.* FROM JOD_users user INNER JOIN JOD_user_profile profile ON user.id = profile.user_id

-1

I Solved by make this query inside my foreach :

select JOD_user_profiles.* from JOD_user_profiles where JOD_user_profiles.user_id =".$row->id." and JOD_user_profiles.profile_key like 'profile5.%'

Thanks a lot.