|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
excluding the trailing comma from info retrieved via mysql... please help
hi--
this is driving me up the wall: i want to retrieve all of the usernames which are currently logged in (something like a users online script)...but i cannot get that darn trailing comma to go away. I've tried rtrim and all sorts of loops and whatnot. ive even tried ben's "who's online" script and integrated it with my users system, however, i can't get rid of it! please steer me in the right direction, as i'm completely lost here ![]()
__________________
-Alexander |
|
#2
|
|||
|
|||
|
I created a simple function for this long ago. I have since integrated a more detailed version of it into a class module.
However, this should do the trick for your needs: Just run your string through this command and off you go: PHP Code:
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
hello laidbak,
thank you-- but now i'm getting two of the same result. so far i am in complete testing stage, there are two registered users...for privacies sake, we'll refer to them as "joe1" and "schmoe1" well, when i use your function, the output i recieve is "Joe1, Joe1" here is the code i am using: (ive based my db class on ben's m/a script) PHP Code:
PS., for some reason, vBulletin wont let me escape my 's so bare that in mind, thank you |
|
#4
|
|||
|
|||
|
Your code is:
PHP Code:
It should be: PHP Code:
Now you don't even need " chop_last_char($username);" Last edited by laidbak : February 17th, 2003 at 03:45 PM. |
|
#5
|
|||
|
|||
|
ahhh genius! thank you very much, im gonna have to start paying you for that function because its awesome eheh.. thank you again--
|
|
#6
|
|||
|
|||
|
Hey,
No problem. I'm glad to hear the solution solved your problem. Happy Coding, |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > excluding the trailing comma from info retrieved via mysql... please help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|