我正在使用基于用户搜索的 PHP 从 MySQL 中检索结果
我想在结果中每 2 秒后自动添加一个
<?php
include_once("config.php");
isset( $_REQUEST['name'] ) ? $name=$_REQUEST['name'] : $name='';
$name = mysql_real_escape_string( $name );
if (strlen($name) >= 4) {
$sql = "select * from places where speciality like '%$name%'";
$rs = mysql_query( $sql ) or die('Database Error: ' . mysql_error
$num = mysql_num_rows( $rs );
if($num >= 1 ){
echo "<table id='result-table'><tr>";
while($row = mysql_fetch_array( $rs )){
echo "<td>row[cname]</td>"; //here i want to add </tr><tr> after 2 <td>s
}
}else{
echo "no records found</table>";
}
}
?>