The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> fetching database info from table ---, info in databse is divided with ","
sanoj96
post Mar 23 2019, 09:53 AM
Post #1


Advanced Member
****

Group: Members
Posts: 118
Joined: 18-September 12
Member No.: 17,803



Hello,


So i have seen this been done (while back) but as of now i cant remember how i can get the info from the database.


So basicly i have an database that have the following info:
CODE

bid          userPosted                location      Members               Status               date
1             NameOfUser             lat/lng        1, 2, 3 ,4               new                  DatePosted


The Members table is holding the ids from the users. How can i get that info divided up.
So i can get the ID and then echo out the name of the user ?



Sorry for my bad english and proberly bad explaination... Feel free to ask questions if you guys didnt understand.

This post has been edited by sanoj96: Mar 23 2019, 10:00 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
CharlesEF
post Mar 23 2019, 05:42 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Or, you can forget about the array plan and try this instead. Just use 'strpos' to test for $users1["id"]. Example:

CODE
if(strpos($rows["members"], $users1["id"]) !== false)
{
  echo $users1["name"];
}
else
{
  echo "[ERROR: No Match Found in our Database]";
}


This post has been edited by CharlesEF: Mar 23 2019, 05:44 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 03:11 PM