如何遍历mySQL表中的元素(一个字段)

How to write PHP code to access the first element till last element of the column Website and to pass the output to another php function.

<?php
$mysqli = new mysqli("localhost", "root", "", "wte");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s
", mysqli_connect_error());
    exit();
}

$query = "SELECT Website FROM websites";

if ($result = $mysqli->query($query)) {

// PHP code to access the first element till last element of the column Website and to pass the output to another php function  

    }

    /* free result set */
    $result->close();
}

/* close connection */
$mysqli->close();
?>
查看全部
duanmeng3126
duanmeng3126
2014/07/27 19:51
  • php
  • mysql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复