[left]$dbname = "Table1";
$link = mysql_connect("localhost","root","");
if(!$link) {
echo "خطایی در برقراری ارتباط با دیتابیس پیش آمده." . " " . mysql_error();
}else{
mysql_select_db($dbname);
mysql_query("SET CHARACTER SET utf8;");
mysql_query("SET SESSION collation_connection = 'utf8_persian_ci'");
$result = mysql_query("SELECT * FROM table",$link);
while($record = mysql_fetch_assoc($result)) {
echo "<table border=1>";
echo "<tr>"."<td>".$record["title"]."</td>"."</tr>"."<tr>"."<td>".$record["body"]."</td>"."</tr>"."</table>";
}
}
mysql_close($link);[/left]