After I finished the 3 Pan Galactic Gargle Blasters, "Tonny Jørgensen"
<tonny@cybercity.dk> just offered me, he muttered some weird stuff,
and I had to correct this gibberish:
<snip kode der ikke virker som den skal>
Din fejl ligger i at du glemmer at kalde mysql_fetch_array på $bum.
Prøv med denne kode i stedet, jeg har dog lavet visse "forbedringer"
nogle steder, koden er utestet. hth.
|<?
|$connection = mysql_connect("localhost","root","") or die("Couldn't connect to database, because: ".mysql_error());
|mysql_select_db("warp",$connection);
|
|$query = "SELECT DISTINCT owner FROM warp";
|$result = mysql_query($query,$connection) or die("\n<br>\n<b>SQL-Fejl:</b> ".mysql_error()."<br>\n<b>SQL:</b> ".$query);
|
|print "<table>";
|
|while ($row = mysql_fetch_array($result)) {
| $query = "SELECT SUM(size) FROM warp WHERE owner = '".$row["owner"]."'";
| $result2 = mysql_query($query,$connection) or die("\n<br>\n<b>SQL-Fejl:</b> ".mysql_error()."<br>\n<b>SQL:</b> ".$query);
| list($size) = mysql_fetch_array($result2);
| print "<tr><td>".$row["owner"]."</td><td>".$size."</td></tr>";
|}
|
|print "</table>";
--
Nano Martin Mouritzen Phone +45 24899896
Vesterbrogade 30C. 2. Programmer Advanced Simplicty
DK-8000 Århus martin@nano.dk
http://www.nano.dk
Nano nu officiel dansk distributør af UltraEdit, se mere på websitet