Kennt jemand eine Funktion, mit der man Daten aus einer MySQL Datenbank auslesen kann?
(In Arrays oder Variablen)
(In Arrays oder Variablen)










<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or die("could not connect"); // Connect zur DB
mysql_select_db("mydb"); // Datenbank auswählen
$select = "SELECT postusername, count(*) as Tuts
FROM 'thread'
WHERE
forumid=17
and
postuserid=postuserid
GROUP BY postusername
ORDER BY Tuts DESC
LIMIT 5";
$test = mysq_query($select);
while ($row = mysql_fetch_array($test)) {
print "postusername: ".$row[postusername]."<br>\n";
print "Tuts: ".$row["Tuts"]."<br>\n";
}
mysql_free_result($test);
?>
Kommentar