Listing All Rows and Fields in a Table Php

<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 Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

three × five =