1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| <html>
<head>
<link rel="icon" type="image/png" href="/images/happy.png" />
<title>Comptes en ligne</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<th>Comptes</th>
<th>Joueurs</th>
<th>Online</th>
<th>Level</th>
</tr>
<?php
$serveur = "localhost";
$nom_base = "characters";
$login = "xxxx";
$motdepasse = "xxxxx";
mysql_connect ($serveur,$login,$pwd) or die ('ERREUR '.mysql_error());
if (mysql_connect ($serveur,$login,$pwd)) {
echo 'Connexion impossible...';
}
else {
echo 'connexion impossible...'.mysql_error();
}
// sélection de la base de données
mysql_select_db ($nom_base) or die ('ERREUR '.mysql_error());
// requete a la base de donnee
$requete = "SELECT id, username, online, last_ip FROM characters WHERE characters";
$resultat = mysql_query ($requete) or die ('Erreur '.$requete.' '.mysql_error());;
$row = mysql_fetch_assoc($resultat);
echo 'le premier enregistrement a pour id '.$requete["id"].' et pour type '.$ligne["type"];
{
$account = $row[0];
$name = $row[1];
$online = $row[2];
$level = $row[3];
}
echo "<tr>
<td>$account</a></td>
<td>$name</td>
<td>$online</td>
<td>$level</td>
</tr> |
Partager