Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Here is the code for pulling the data for my array

<?php
    $link = mysqli_connect('localhost', 'root', '', 'mutli_page_form');

    $query = "SELECT * FROM wills_children WHERE will=73";

    $result = mysqli_query($link, $query) or die(mysqli_error($link));

    if ($result = mysqli_query($link, $query)) {

    /* fetch associative array */
    if($row = mysqli_fetch_assoc($result)) {
        $data = unserialize($row['children']);
    }

    /* free result set */
    mysqli_free_result($result);
    }
?>

When I use print_r($data) it reads as:

Array ( [0] => Array ( [0] => Natural Chlid 1 [1] => Natural Chlid 2 [2] => Natural Chlid 3 ) ) 

I would like it to read as:

Natural Child 1
Natural Child 2
Natural Child 3

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
215 views
Welcome To Ask or Share your Answers For Others

1 Answer

Instead of

print_r($data);

try

print "<pre>";
print_r($data);
print "</pre>";

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...