PHP 列出数据库中数据
2017-01-01 19:22
183 查看
php列出数据库中数据
<?php $row = $rows = array(); $sql=mysql_query("SELECT * FROM shouzhi ORDER BY shouzhi_time DESC"); $total = mysql_num_rows($sql); while($row = mysql_fetch_array($sql) ){ $rows[]=$row; } /* print_r($rows); echo '<hr>'; for ($i=$total-1; $i<$total & $i>=0; $i--){ echo date('ym',strtotime('-1 month' .$rows[$i]['shouzhi_riqi'])).','; echo $rows[$i]['shouzhi_shou'].',';} echo '<hr>'; echo $rows['0']['shouzhi_riqi'].$rows['0']['shouzhi_yu']; echo $total; */ ?>
相关文章推荐
- PHP中在数据库中保存Checkbox数据(1)
- PHP中在数据库中保存Checkbox数据(1)
- php中使用ExcelFileParser处理excel获得数据(可作批量导入到数据库使用)
- php的CodeIgniter框架中如何过滤数据(将危险数据如html类型的数据过滤后提交到数据库)
- Php从数据库里读出数据,并生成xml文件
- 用php列出数据库的字段
- php利用数组函数,查询并删除数据库多列重复数据
- PHP中在数据库中保存Checkbox数据(1)
- php实现session数据存储到数据库
- php把从数据库读取出来的数据存放到数组里
- php录入页面中动态从数据库中提取数据的实现
- php从数据库中读取数据生成xml文件的方法
- php录入页面中动态从数据库中提取数据的实现
- PHP——向数据库插入数据时乱码的解决方法
- 列出数据库中有数据的表的名称和数据
- PHP中在数据库中保存Checkbox数据(2)
- PHP连接MySQL数据库及以表格输出数据库数据的实现
- php从数据库中读取数据生成xml文件的方法
- 在php中操作数据库中的数据(增,删,改,查)
- 列出数据库中有数据的表的名称和数据