PHP中使用MySQL的视图
时间:2011-03-27 来源:卖身葬小强
<?php $mysqli=new MySQLi("localhost","root","123456","xiaoqiangdb"); $sql="select * from myview order by chengji"; $result=$mysqli->query($sql); echo '<table align="center" border="1">'; while($row=$result->fetch_assoc()){ echo '<tr>'; foreach($row as $col){ echo '<td>'.$col.'</td>'; } echo '</tr>'; } echo '</table>'; $mysqli->close(); ?>
相关阅读 更多 +