0

This is my communication_posting table

enter image description here

Into fields 2,3 are user_id in user_master table. This is my user_master table (used for login ).

enter image description here

I want to get session_id means store in to column in communication_posing table but here two session_id (mean user_id) has store how to get only one from them.

dipti
  • 71
  • 7

1 Answers1

0

If you are doing this in two seperate queries, you can use php explode().

$explode_array = explode(',', $database_result['to']);
$value_you_want = $explode_array[0];

If you need to do this in SQL, create a split function in MySQL. This question has some answers that will help.

Can you split/explode a field in a MySQL query?

Goose
  • 4,764
  • 5
  • 45
  • 84