//grab the all the post comments replies
function grab_all_post_comment_replies_parent_ids($post_id){
//filter string to contain only numbers just in case
$post_id = filter_numbers($post_id);
//escape special characters in the string for use in the MySQL statement
$post_id = mysqli_real_escape_string(database(), $post_id);
$query = "SELECT `posts`.`post_id`
FROM `posts`
WHERE `parent_id` = '$post_id'
AND `level` = '1'";
//short hand if statement ? if-true : if-false to determine the number of results returned by the query
$count = ($query = mysqli_query(database(), $query)) ? mysqli_num_rows($query) : 0;
if($count === 0){
//query returned 0 meaning no results so return false as the value for the function
return false;
} else {
while($row = mysqli_fetch_array($query)){
$results[] = $row['post_id'];
}
return $results;
}
}
function all_post_comment_replies($post_id){
$total = count(grab_all_post_comment_replies_parent_ids($post_id));
$sum = 0;
$all_ids = array();
if(is_array(grab_all_post_comment_replies_parent_ids($post_id))){
foreach(grab_all_post_comment_replies_parent_ids($post_id) as $parent_id){
//filter string to contain only numbers just in case
$parent_id = filter_numbers($parent_id);
//escape special characters in the string for use in the MySQL statement
$parent_id = mysqli_real_escape_string(database(), $parent_id);
$query = "SELECT *
FROM `posts`
WHERE `parent_id` = '$parent_id'
AND `level` = '2'";
//short hand if statement ? if-true : if-false to determine the number of results returned by the query
$count = ($query = mysqli_query(database(), $query)) ? mysqli_num_rows($query) : 0;
if($count === 0){
//query returned 0 meaning no results so return false as the value for the function
return false;
} else {
while($row = mysqli_fetch_array($query)){
$ids[] = $row['post_id'];
}
$all_ids = $ids;
}
if($sum = $total){
return $all_ids;
} else {
return false;
}
$sum++;
}
} else {
return false;
}
}
这是我的Mainactivity可以帮助我解决问题当我点击它给我的电话号码错误"错误net :: err_unknown_url_scheme tel:"