You are currently viewing Listing All Rows and Fields in a Table Php

Listing All Rows and Fields in a Table Php

Spread the love
<html>
<head>
<title>Selecting Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9" />
</head>
<body>
<?php
include("baglan.php");
?>
<?php
mysql_connect($hostaneme,$username,$password );
$result = mysql_query( "SELECT marka FROM tnm_aracmarka WHERE marka LIKE 'A%'" );
$num_rows = mysql_num_rows( $result );
print "<table>";
while ( $a_row = mysql_fetch_row( $result ) ) {
print "<tr>";
foreach ( $a_row as $field ) {
print "<td>".stripslashes($field)."</td>";
}
print "</tr>";
}
print "</table>";
mysql_close( $connection );
?>
</body>
</html>

 

Bir yanıt yazın

This site uses Akismet to reduce spam. Learn how your comment data is processed.