PHP-Code:
$sql = mysql_query("SELECT * FROM tabelle WHERE id='1'");
$daten = mysql_fetch_assoc($sql);
echo $daten["Name"];
ich es in der form dann stehen habe
PHP-Code:
$Spieler1 = "Name";
danke für jeden Tip
$sql = mysql_query("SELECT * FROM tabelle WHERE id='1'");
$daten = mysql_fetch_assoc($sql);
echo $daten["Name"];
$Spieler1 = "Name";
<?php
$sql = "SELECT * FROM kds WHERE vote = '$spieler1'";
$resultwon = mySQL_query($sql, $conn);
$rowwon = mySQL_num_rows($resultwon);
echo "$rowwon";
?>
SELECT COUNT(*) FROM kds WHERE vote = '$spieler1'
SELECT vote, COUNT(*) FROM kds GROUP BY vote
<?
$sql2 = mysql_query("SELECT * FROM kds WHERE id='2'");
$daten = mysql_fetch_assoc($sql2);
$Spieler2 = $daten["Name"];
$sql = "SELECT * FROM kds WHERE vote = '$Spieler2'";
$resultwon = mySQL_query($sql, $conn);
$rowwon = mySQL_num_rows($resultwon);
echo "$rowwon";
?>
<?
$res = mysql_query('SELECT vote, COUNT(*) cnt FROM kds GROUP BY vote') or die(mysql_error());
while ($row = mysql_fetch_assoc($res))
{
echo 'vote: '.$row['vote'].'<br />';
echo 'anzahl: '.$row['cnt'].'<br /><br />';
}
?>
Kommentar