Created
February 9, 2012 12:56
-
-
Save flexd/1779826 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<?php | |
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til db"); | |
mysql_select_db("kristoffer") or die("Kan ikke koble til"); | |
?> | |
<table width="50%" border="1"><tr><td>Navn</td><td>Alder</td></tr> | |
<?php | |
$sql= "select * from person" ; | |
$resultat=mysql_query($sql); | |
$antall=mysql_num_rows($resultat); | |
for ($i=0; $i <$antall; $i++){ | |
$rad=mysql_fetch_row($resultat); | |
echo '<tr><td>'; | |
echo $rad[0]; | |
echo '</td><td>'; | |
echo $rad[1]; | |
echo '</td></tr>'; | |
} | |
?> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment