Code:
$Query = mysql_query("SELECT id,name,guild,guildrank,zonename,
(ascii(mid(profile,117,1)))+(ascii(mid(profile,118,1))*256)+(ascii(mid(profile,119,1))*4096)+(ascii(mid(profile,120,1))*65536) as level,
(ascii(mid(profile,105,1)))+(ascii(mid(profile,106,1))*256)+(ascii(mid(profile,107,1))*4096)+(ascii(mid(profile,108,1))*65536) as race,
(ascii(mid(profile,109,1)))+(ascii(mid(profile,110,1))*256)+(ascii(mid(profile,111,1))*4096)+(ascii(mid(profile,112,1))*65536) as pclass,
(ascii(mid(profile,101,1)))+(ascii(mid(profile,102,1))*256)+(ascii(mid(profile,103,1))*4096)+(ascii(mid(profile,104,1))*65536) as gender,
(ascii(mid(profile,164,1))) as gm,
(ascii(mid(profile,165,1))) as anon,
mid(profile,69,30) as lastname,
profile
FROM character_ WHERE id = $charid");
$Char = mysql_fetch_array($Query);
Theres something that should help you out a bit. Took it from the Raid Addicts panel I made.