• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Castle War Owner Script

Newbie Spellweaver
Joined
Sep 19, 2016
Messages
14
Reaction score
0
I search a working Castle War owner script for my Website, any1 have one for me? Or can help me to get one? TY For ur help.
 
Joined
Oct 10, 2012
Messages
798
Reaction score
292
I search a working Castle War owner script for my Website, any1 have one for me? Or can help me to get one? TY For ur help.

<?php
$config = array(
'db_username' => 'name', // database username
'db_password' => 'pw', // database password
'db_dsn' => 'dns', // system DSN to the database
'debug' => false,
);



$conn = odbc_connect($config['db_dsn'],
$config['db_username'],
$config['db_password']);


$guild_query = odbc_exec($conn,"SELECT [GID] FROM GuildCastle WHERE CID = 1");

$guild2 = odbc_fetch_array($guild_query);
$guildGID = $guild2[0];

$guild_query = odbc_exec($conn,"SELECT [Name] FROM Guild WHERE GID = '".$guildGID."'");
$guild2 = odbc_fetch_array($guild_query);
$guild = $guild2[0];

if($guild)
echo "<p>Castle Owner: $guild</p>";
else
echo "<p>Castle Owner: None</p>";
?>
 
Upvote 0
Experienced Elementalist
Joined
Aug 21, 2012
Messages
243
Reaction score
27
PHP:
<?php
 $config = array(
 'db_username' => 'sa', // database username
 'db_password' => 'yourdbpassword', // database password
 'db_dsn' => 'Driver={SQL Server};Server=YOURSERVER\SQLEXPRESS;Database=kal_db;', // system DSN to the database

 'debug' => false, // show SQL errors if true
 );


 $conn = odbc_connect($config['db_dsn'],
 $config['db_username'],
 $config['db_password']);
 ?>
 <?php
error_reporting(0);
 $plist = 'SELECT [Name] FROM dbo.Guild WHERE [GID] IN (SELECT [GID] FROM dbo.GuildCastle)';
 $rs = odbc_exec($conn,$plist);
 while($r = odbc_fetch_array($rs))
 {
 $dump = "'.$r[1].'";
 echo "".$r[Name]."</font>";
 $oo = $r[Name];
 } 

 if(empty($oo)){echo 'NONE';}; 
 ?>
 
Upvote 0
Back
Top