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?

Member Avatar for diafol

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.