Here is what i'v gote but!
<?php
$db_serv = ''; //the address of the database goes here
$db_user = ''; //your sql username goes here
$db_pass = ''; //your sql password goes here
$db_name = ''; //your database name goes here
$filename = './helios.js'; //generated javascript file you need to put attribute 777 in your folder
//-----------------------------------------------------------------------------------------------
@mysql_connect ( $db_serv, $db_user, $db_pass ) or die ('Coudn\'t connect to host');
@mysql_select_db( $db_name ) or die ('Couldn\'t select database');
$sql = @mysql_query('SELECT id,name,tax_percent,siege_date FROM `castle`') or die('Query failed!');
$gen = "\n";
while ($castle = @mysql_fetch_array($sql))
{
$gen .= "\n".strtolower($castle['name']) . 'info = \'<div class="castleWrapper">';
$gen .= '<div class="castlePic" id="' . ucfirst(strtolower($castle['name'])) . 'Pic"></div>';
$gen .= '<div class="castleInfo">';
$gen .= '<div class="castleName"><strong>' . ucfirst(strtolower($castle['name'])) . ' Castle</strong></div>';
$clan = @mysql_fetch_array(mysql_query('SELECT clan_name,hasCastle FROM `clan_data` WHERE hasCastle = ' . $castle['id']));
$clan_name = (isset($clan['clan_name'])) ? htmlspecialchars($clan['clan_name'], ENT_QUOTES) : 'UNCLAIMED';
$gen .= '<div><strong>Controlled by:</strong> ' . $clan_name . '</div>';
if (isset($clan['clan_name'])) $gen .= '<div><strong>Tax Rate:</strong> ' . $castle['tax_percent'] . '%</div>';
$gen .= '<div><strong>Next Siege:</strong> ' . date('M d Y ',$castle['siege_date']/1000) . '</div>';
$gen .= '</div></div>\';'."\n\n";
}
$handle = @fopen($filename, 'w+');
@fwrite($handle, $gen);
@fclose($handle);
?>
my tables are not like l2jserver tables ...
clan_data only have clan_id
and clan_name is in table clan_subpledges
how can i config the php to show clan name ?
tnx in advance!