问题描述:
for ($count = 1; $row = $result->fetch_row(); ++$count) 这句话怎么解释?它是怎么循环的?
function get_user_urls($username)
{
//extract from the database all the URLs this user has stored
$conn = db_connect();
$result = $conn->query( "select bm_URL
from bookmark
where username = '$username'");
if $result)
return false;
//create an array of the URLs
$url_array = array();
for ($count = 1; $row = $result->fetch_row(); ++$count)
{
$url_array[$count] = $row[0];
}
return $url_array;
}
for ($count = 1; $row = $result->fetch_row(); ++$count) 这句话怎么解释?它是怎么循环的?
$count =1,为什么不是0,可以为0不?
function get_user_urls($username)
{
//extract from the database all the URLs this user has stored
$conn = db_connect();
$result = $conn->query( "select bm_URL
from bookmark
where username = '$username'");
if $result)
return false;
//create an array of the URLs
$url_array = array();
for ($count = 1; $row = $result->fetch_row(); ++$count)
{
$url_array[$count] = $row[0];
}
return $url_array;
}
for ($count = 1; $row = $result->fetch_row(); ++$count) 这句话怎么解释?它是怎么循环的?
$count =1,为什么不是0,可以为0不?
问题解答:
我来补答展开全文阅读