fetching database info from table ---, info in databse is divided with "," |
fetching database info from table ---, info in databse is divided with "," |
sanoj96 |
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 |
CharlesEF |
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 |
Lo-Fi Version | Time is now: 26th April 2024 - 07:46 PM |