Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

castle owner script problems..

Experienced Elementalist
Joined
Nov 10, 2007
Messages
260
Reaction score
2
hi all, i took this script from Kalonline Website Thread

well when there isnt any castle owner then it writes nothing.. i dont know why

here is the script:

<?php
//if you use windows auth mode
$msconnect = mssql_connect("localhost");
$msdb = mssql_select_db("kal_db", $msconnect);
$plist = "SELECT [Name] FROM Guild WHERE [GID] = (SELECT [GID] FROM GuildCastle)";
$pplist = mssql_query($plist);

while($list = mssql_fetch_array($pplist)){
if($list[Name] == ""){
$gn = "No Guild";
}
else
{
$gn = $list[Name];
}
echo "<b>";
echo $gn;
echo "</b>";
}
?>



i just think there is something messed up cause there is a line [ $gn = "No Guild"; ]

if someone would tell me what the problem is i would be grateful

thanks anyway :)
 
Live Now, Work Later
Joined
Sep 12, 2006
Messages
153
Reaction score
4
Heres the one i use:

<?php
$msconnect = mssql_connect("localhost","Username","Password");
$msdb = mssql_select_db("kal_db", $msconnect);

$guild_query = mssql_query("SELECT [GID] FROM GuildCastle WHERE CID = 1");
$guild2 = mssql_fetch_array($guild_query);
$guildGID = $guild2[0];

$guild_query = mssql_query("SELECT [Name] FROM Guild WHERE GID = '".$guildGID."'");
$guild2 = mssql_fetch_array($guild_query);
$guild = $guild2[0];
if($guild)
echo "<font size=1 face=Agency FB><b>span style='color:green'>$guild</b></font>";
else
echo "<font size=1 face=Agency FB><span style='color:blue'><b>No One</b></span></font>";
?>
 
Upvote 0
Experienced Elementalist
Joined
Nov 10, 2007
Messages
260
Reaction score
2
ohh, thank you very much

it works fine ;) --->
 
Upvote 0
Live Now, Work Later
Joined
Sep 12, 2006
Messages
153
Reaction score
4
your welcome :)

btw mukso you spelt Maintrance wrong -> Maintenance
 
Upvote 0
Experienced Elementalist
Joined
Nov 10, 2007
Messages
260
Reaction score
2
ahh, i was always fool to read all correctly :X

kk ty for info ill fix it soon atm (splash on GenU)



Edit: kk now Maintenance :)
 
Last edited:
Upvote 0
Back
Top