<html>
<head>
<title>Заголовок документа</title>
</head>
<body>
<?php
$con = mysql_connect("localhost","root","");
if (!$con) {
die ("Can not connect: ".mysql_error());
}
mysql_select_db("Proba",$con);
function get_products_to_array ($result){
$res_array = array();
$count = 0;
while ($row = mysql_fetch_array($result)){
$res_array[$count] = $row;
$count ++;
}
return $res_array;
}
function get_products (){
$query = "SELECT * FROM add_post ORDER BY id DESC";
$result = mysql_query($query);
$result = get_products_to_array($result);
return $result;
}
mysql_close($con);
?>
</body>
</html>
$query = "SELECT * FROM add_post ORDER BY id DESC";
$rows= mysql_query($query);
<table>
<?php while($row = mysql_fetch_assoc()): ?>
<tr>
<td><?php print $row['title'] ?></td>
</tr>
<?php endwhile; ?>
</table>