0

Hello i want to create a script like this

$query=mysqli_query($this->db,"SELECT * FROM table WHERE to_user_id='$uid' ORDER BY id DESC")or die(mysqli_error($this->db));

but the to_user_id row has multiple values. (45,67,234)
Lets say that one of them (45) is the $uid
note: the $uid variable is called on a session file. Its the id of the session user
How do i split and use only the session user id (for example 45) which is the $uid valiable?

2
Contributors
1
Reply
16
Views
1 Year
Discussion Span
Last Post by diafol
2

Why has it got multiple values?? Looks like a straight index to me. Looks like your schema is wrong. You should have a link table by the looks of it. However you can use FIND_IN_SET for this.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.