Jump to content
  • 0

pomoc Banlist nezobrazuje se


1Kubad1

Dotaz

zdravim potrebuju pomoct hledal jsem banlist atd a ruzne navody jak pripojit mysql databazi databaze mi predtim sla pripojit a vse se ukazovalo tak jsem zkusil trochu predelat atd a proste ted mi to nic neukazuje

<?php
   $server = "********";
   $dbuser = "********";
   $dbpass = "********";
   $dbname = "********";
   
mysql_connect($server, $dbuser, $dbpass);
mysql_select_db($dbname);


$result = mysql_query("SELECT * FROM CTBan_Log ORDER BY time DESC");


echo "<table border=1 cellpadding=5 cellspacing=0>";


echo "<td>Kdy: </td>
<td>Jmeno</td>
<td>Steam ID</td>
<td>Admin</td>
<td>Na Jak Dlouho</td>
<td>Duvod</td>";


while($row = mysql_fetch_assoc($result)){


echo "<td>".$row['timestamp']."</td>";
echo "<td>".$row['perp_name']."</td>";
echo "<td>".$row['perp_steamid']."</td>";
echo "<td>".$row['admin_name']."</td>";
echo "<td>".$row['timeleft']."</td>";
echo "<td>".$row['reason']."</td>";


echo "</tr>";
}


echo"</table>"


?>
 
Link to comment
Share on other sites

Recommended Posts

  • 0

Nějakou chybu to vypisuje?

 

 

//Chybí ti tam , BTW ta tabulka je celá nějaká divná. 

echo('<tr>');

Zkus tu tabulku napsat správně takto:

echo('<table border="1" cellpadding="5" cellspacing="0">');
echo('<thead>');
echo('<th>Kdy:</th>');
echo('<th>Jmeno:</th>');
echo('<th>Steam ID:</th>');
echo('<th>Admin</th>');
echo('<th>Na jak dlouho:');
echo('<th>Důvod:</th>');
echo('</thead>');
echo('<tbody>');

while($row = mysql_fetch_assoc($result))
{
     echo('<tr>');
     echo('<td>'.$row['timestamp'].'</td>');
     echo('<td>'.$row['perp_name'].'</td>');
     echo('<td>'.$row['perp_steamid'].'</td>');
     echo('<td>'.$row['admin_name'].'</td>');
     echo('<td>'.$row['timeleft'].'</td>');
     echo('<td>'.$row['reason'].'</td>');
     echo('</tr>');
}
echo('</tbody');
echo('</table>');
Edited by Petr Hnátek
Link to comment
Share on other sites

  • 0

nevidim chybu a co je tam divny ?


porad to nejde  to mysql


+ vim ze to neni jako to tabulkou ale tim mysql vubec nevim vcem je chyba ale nic mi nevypisuje z 

 
timestamp perp_steamid perp_name admin_steamid admin_name bantime timeleft reason
Link to comment
Share on other sites

  • 0

Připoj se takto a řekni, zda to píše nějakou chybu. Hlavně se ujisti, že nemáš barvu textu na stránce stejnou, jako je barva pozadí. 

$server = ' ';
$username = ' ';
$password = ' ';

mysql_connect($server, $username, $password)
or die(mysql_error());

mysql_select_db(' ') 
or die(mysql_error());

echo('Připojeno!');
Edited by Petr Hnátek
Link to comment
Share on other sites

  • 0

<html><body>
<center><img src='http://img813.imageshack.us/img813/4964/headeruw.png' border='0'/></center>
<br>
<br>
<style>
body {
background-image: URL('http://herocraftonline.com/wordpress/wp-content/themes/herocraft/images/bg.gif');
background-attachment: fixed;
background-color: black;
background-repeat: repeat-x; }
</style>


<center>
<?php


// change these things


   $server = "penis";
   $dbuser = "penis";
   $dbpass = "penis";
   $dbname = "penis";
   


mysql_connect($server, $dbuser, $dbpass);
mysql_select_db($dbname);


$result = mysql_query("SELECT * FROM banlist ORDER BY time DESC");


echo "<table width=70% border=1 cellpadding=5 cellspacing=0>";


echo "<tr style=\"font-weight:bold; color:white\">
<td>Jmeno</td>
<td>Duvod</td>
<td>Admin/Mod</td>
<td>Zabanovan</td>
<td>Vyprsi</td>
</tr>";


while($row = mysql_fetch_assoc($result)){


if($col == "#eeeeee"){
$col = "#ffffff";
}else{
$col = "#eeeeee";
}
echo "<tr bgcolor=$col>";


echo "<td>".$row['name']."</td>";
echo "<td>".$row['reason']."</td>";
echo "<td>".$row['admin']."</td>";
echo "<td>".$row['time']."</td>";
if($row['temptime'] == "0000-00-00 00:00:00"){
echo "<td>Permanent</td>";
}else{
echo "<td>".$row['temptime']."</td>";
}


echo "</tr>";
}


echo"</table>"


?>


<span style="color:white">Copyright © 2011 penis</span>
</center>
</body></html>
Link to comment
Share on other sites

  • 0
$result = mysql_query("SELECT * FROM CTBan_Log ORDER BY time DESC");

Máš zde ORDER BY time, ale v databází žádný sloupec s názvem time nemáš. 

 

Místo time dej timestamp

 

Jinak </tbody>

Edited by Petr Hnátek
Link to comment
Share on other sites

  • 0

jo uz to jde jenom mala vec ten timestamp       echo('<td>'.$row['timestamp'].'</td>'); tak to ukazuje nake divne cisla vim ze se tam ma pouzit nakej kod ale netusim jakej

Link to comment
Share on other sites

  • 0

zkus

while($row = mysql_fetch_assoc($result))
{
     $timestamp = $row['timestamp'];
     echo('<tr>');
     echo('<td>'.gmdate('Y-m-d H:i:s', $timestamp).'</td>');
     echo('<td>'.$row['perp_name'].'</td>');
     echo('<td>'.$row['perp_steamid'].'</td>');
     echo('<td>'.$row['admin_name'].'</td>');
     echo('<td>'.$row['timeleft'].'</td>');
     echo('<td>'.$row['reason'].'</td>');
     echo('</tr>');
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...