dptx8888 2014-03-07 11:08
浏览 45
已采纳

如何在没有while循环的情况下使用mysql_fetch_array

hey i want to use php mysql_fetch_array to fetch full table data at a time for that i use

while($user_details_result[]=mysql_fetch_assoc($user_details_qr));

but it returns a blank array at last like below

output:

Array
(
    [0] => Array
        (
            [user_id] => 2
            [user_name] => w
            [user_login_id] => w
            [user_login_password] => w
            [user_contacts] => w
            [user_status] => 0
            [user_post_date] => ::1
            [user_post_ip] => 2014-03-07 16:17:59
        )

    [1] => Array
        (
            [user_id] => 1
            [user_name] => q
            [user_login_id] => q
            [user_login_password] => q
            [user_contacts] => q
            [user_status] => 1
            [user_post_date] => ::1
            [user_post_ip] => 2014-03-07 16:14:23
        )

    [2] => 
)

i dont understand why 3 rd row appears..please help

  • 写回答

3条回答 默认 最新

  • drwiupraq047311240 2014-03-07 11:13
    关注

    Use this

    while($temp=mysql_fetch_assoc($user_details_qr)) {
        user_details_result[] = $temp;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了