dshmkgq558192365 2015-02-03 20:03
浏览 22

Newbe,MySQL查询跳过第一个条目 - 没有重复的fetch_array

trying to get my head around this MySQL jibberish, lol - now I do not normally ask for help but on this one I think I do need a shove.

I have searched for the answers to this however the solutions are all based around the askers duplication of the fetch_array command, however I have not done this but still this code skips the first entry.

Can someone point out what I have done here that causes this to skip...?

code:

$link = mysqli_connect('localhost','person','password', 'database'); // connect to database 
if (!$link) { die('Could not connect to MySQL: ' . mysqli_connect_error()); }   // problem, then die

$sql = "SELECT * FROM id_info_db"; // Query construct
$result = mysqli_query($link, $sql);  //query action

while ( $row = mysqli_fetch_array($result) ) {    // print out rows
        echo "User: " . $row["username"]. " - Password: " . $row["password"]. " " . $row["email"]. "<br>"; }

mysqli_close($link);
  • 写回答

1条回答 默认 最新

  • dongyuan7110 2015-02-03 23:03
    关注

    For some reason I had a loose /body tag at the end? why I don't know but it generated this result. Now I have deleted it the output is correct. A remnant that should have been deleted that throws up an unfathomable error. Lol

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制