16-09-2007, 09:08 PM
Sa ne marche toujours pas:
Code PHP :
<?php
if ( $atk > $defadv )
{
echo
mysql_connect("localhost", "ninjaandcat", "¤¤¤¤¤¤¤"); // Connexion à MySQL
mysql_select_db("ninjaandcat");
$reponse = mysql_query("SELECT * FROM membres WHERE pseudo='Necromant'"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
$atkadv = mt_rand(30,50);
$defadv = mt_rand(30,80);
$pv = $donnes['pv'];
$atk = $donnees['atk'];
$dga = $donnees['atk'] - $defadv ;
$pva = $pva - $dga ;
echo '<a href="fight.php?pva=$pva&pseudo=Necromant">continuer</a>;';
}
}
else
{
echo
mysql_connect("localhost", "ninjaandcat", "¤¤¤¤¤¤¤"); // Connexion à MySQL
mysql_select_db("ninjaandcat"); // Sélection de la base coursphp
$reponse = mysql_query("SELECT * FROM membres WHERE pseudo='Necromant'"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
$atkadv = mt_rand(30,50);
$pv = $atkadv - $donnes['pv'];
$soif = $donnes['soif'] - 2;
$miam = $donnes['miam'] - 2;
echo '<a href="fight.php?pva=$pva&pseudo=Necromant">louze</a><br />;';
mysql_query("UPDATE membres SET pv='$pv', soif='$soif', miam='$miam' WHERE pseudo='Necromant'");
}
}
mysql_close(); // Déconnexion de MySQL
?>