PHP中将内容循环出来

首先连接数据库:

$myDate= @mysql_connect("localhost","root","") or die("数据库连接失败,请检查你的网络,稍后再试");
mysql_select_db("test");
mysql_query("set names 'utf8'");

在写要执行的语句:

$tables = mysql_query("select * from move_table");

 

最后用

<?php
while($row = mysql_fetch_array($tables)){
?>

 

这里是你要循环的内容

 

 

<?php

}

?>

你可能感兴趣的:(PHP)