[Help]MySQL table fetch

Posted on Wednesday 23rd July 2008 at 10:40 PM
IcedEarth
IcedEarth's Avatar
I have an table called Guilds, but thing is when someone creates guild, it adds to GuildLeader like this IcedEarth:blahblah:blahblah that blahblah:blahblah is needed but how can i fetch the name for GuildLeader only i mean fetch IcedEarth not whole row ? Any help is welcome.
Posted on Wednesday 23rd July 2008 at 11:08 PM
ShadowMage
ShadowMage's Avatar
use the explode function ;) Ex:
Code
$MyText = "Leader:sub:sub:sub:Me";
$exArray = explode(":", $MyText); //its stored in an array
//$exArray[1] is Leader
print_r($exArray);
failure i sense
Posted on Wednesday 23rd July 2008 at 11:20 PM
IcedEarth
IcedEarth's Avatar
hm... this gives me a some rows that i don't even have in database :S
Posted on Wednesday 23rd July 2008 at 11:36 PM
ShadowMage
ShadowMage's Avatar
print_r is used to print arrays :S
failure i sense
Posted on Thursday 24th July 2008 at 12:25 AM
IcedEarth
IcedEarth's Avatar
Thank's MOD-Shadow, you the best i have seen ! +1 reputatsion from me.
Login or register to respond to this forum topic.