home *** CD-ROM | disk | FTP | other *** search
- <HTML>
- <HTML>
- <?php
- // Connecting, selecting database
- $link = mysql_connect("localhost:3306", "web", "b84ufishy")
- or die("Could not connect");
- print "Connected successfully";
- mysql_select_db("bliss")
- or die("Could not select database");
-
- // Performing SQL query
- $query = "SELECT * FROM smpcntr";
- $result = mysql_query($query)
- or die("Query failed");
-
- // Printing results in HTML
- print "<table
- border=1><TR><TD><B>id</B></TD><TD><B>page</B></TD><TD><B>referer</B></TD><TD><B>browser</B></TD></TR>\n";
- while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
- print "\t<tr>\n";
- foreach ($line as $col_value) {
- print "\t\t<td>$col_value</td>\n";
- }
- print "\t</tr>\n";
- }
- print "</table>\n";
-
- // Closing connection
- mysql_close($link);
- ?>
-