Fr4n-FX
08-23-2012, 04:05 PM
function connect()
{
$db_user = "user";
$db_pass = "pass";
$db_name = "namedb";
$db_serv = "localhost";
$res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");
$resdb = mysql_select_db ( "$db_name",$res );
return $res;
}
$time = array('$row[3]/60' => "$row[4]");
$sexes = array('M', 'F');
$FORM = "<table border='1'>
<tr>
<td align='center'>Pos.</td>
<td align='center'>Char. Name</td>
<td align='center'>Level</td>
<td align='center'>Sex</td>
<td align='center'>Jail Time</td>
</tr>";
$query_chars = "select char_name,level,sex,punish_timer from characters WHERE punish_level=1 order by punish_timer asc limit 10;";
connect();
$link = mysql_query($query_chars);
$i=1;
$r=255;
while ( $row=mysql_fetch_row($link) )
{
$jailer=$row[3]/1000;
$datetime = gmstrftime("%H:%M:%S", $jailer);
$link2 = mysql_query($query);
$FORM .= "<tr>
<td align='center'>$i</td>
<td align='center'>$row[0]</td>
<td align='center'>$row[1]</td>
<td align='center'>".$sexes[$row[2]]."</td>
<td align='center'>$datetime</td>
</tr>";
$i++;
$r -= 0;
}
mysql_close();
$output = $FORM;
Is posible to display this code in cms pages correctly?
--------------- Added 1345741765 at 1345741765 ---------------
Its another database in the same machine ...
{
$db_user = "user";
$db_pass = "pass";
$db_name = "namedb";
$db_serv = "localhost";
$res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");
$resdb = mysql_select_db ( "$db_name",$res );
return $res;
}
$time = array('$row[3]/60' => "$row[4]");
$sexes = array('M', 'F');
$FORM = "<table border='1'>
<tr>
<td align='center'>Pos.</td>
<td align='center'>Char. Name</td>
<td align='center'>Level</td>
<td align='center'>Sex</td>
<td align='center'>Jail Time</td>
</tr>";
$query_chars = "select char_name,level,sex,punish_timer from characters WHERE punish_level=1 order by punish_timer asc limit 10;";
connect();
$link = mysql_query($query_chars);
$i=1;
$r=255;
while ( $row=mysql_fetch_row($link) )
{
$jailer=$row[3]/1000;
$datetime = gmstrftime("%H:%M:%S", $jailer);
$link2 = mysql_query($query);
$FORM .= "<tr>
<td align='center'>$i</td>
<td align='center'>$row[0]</td>
<td align='center'>$row[1]</td>
<td align='center'>".$sexes[$row[2]]."</td>
<td align='center'>$datetime</td>
</tr>";
$i++;
$r -= 0;
}
mysql_close();
$output = $FORM;
Is posible to display this code in cms pages correctly?
--------------- Added 1345741765 at 1345741765 ---------------
Its another database in the same machine ...