Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 190
0 Users 5 Guests Online
Forum Index » PHP + MySQL » [Help]MySQL table fetch
Posted on Wednesday 23rd July 2008 at 10:40 PM
IcedEarth
templates/default/images/noavatar.png's Avatar
Newbie
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
templates/default/images/noavatar.png's Avatar
Senior Member
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);
Posted on Wednesday 23rd July 2008 at 11:20 PM
IcedEarth
templates/default/images/noavatar.png's Avatar
Newbie
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
templates/default/images/noavatar.png's Avatar
Senior Member
print_r is used to print arrays :S
Posted on Thursday 24th July 2008 at 12:25 AM
IcedEarth
templates/default/images/noavatar.png's Avatar
Newbie
Thank's MOD-Shadow, you the best i have seen ! +1 reputatsion from me.