php - Code has no errors but it's not showing any data -
i working on wallpost script, page has no errors, i've check database (the query worked there) , i've tried think can, not work. don't know else do, if have ideas why won't work, show me. ps: database has dummy data in it.
<?php include 'inc/dbc.php'; include 'inc/functions.php'; if(isset($_get['user']) && !empty($_get['user'])) { $username = $_get['user']; } else { $username = $_session['username']; } $my_name = $_session['username']; $firstname = getuser($username, 'firstname'); $middlename = getuser($username, 'middlename'); $lastname = getuser($username, 'lastname'); $aboutme = getuser($username, 'aboutme'); $email = getuser($username, 'email'); $dob = getuser($username, 'dob'); $address = getuser($username, 'address'); $website = getuser($username, 'website'); $country = getuser($username, 'country'); $city = getuser($username, 'city'); $state = getuser($username, 'state'); $phone = getuser($username, 'phone'); $gender = getuser($username, 'gender'); $rank = getuser($username, 'rank'); $avatar = getuser($username, 'avatar'); $reg_date = getuser($username, 'reg_date'); ?> <?php if (loggedin() == true) { $chech_posts = mysqli_query($mysqli, "select * wallposts posted_to = '$username' , deleted = 0 "); $check = mysqli_num_rows($chech_posts); if ($check == false) { echo '<li>error getting posts</li>'; } else { while ($run = mysqli_fetch_array($check)) { $post_id = $run['post_id']; $postby = $run['posted_by']; $postto = $run['posted_to']; $post = $run['post']; $post_date = $run['post_date']; $post_time = $run['post_time']; $p_avatar = getuser($postby, 'avatar'); $p_first = getuser($postby, 'firstname'); $p_last = getuser($postby, 'lastname'); ?> <li class='wall' id='<?php echo $post_id;?>'> <div class='post'> <div class='post-container'> <div class='post-header'> <div class='pull-left'><?php echo $postby;?></div> <div class='post-img'><img src="images/users/<?php echo $p_avatar;?>" alt="<?php echo $p_first . ' ' . $p_last . '\'s profile picture' ;?>" class="img-circle" align="middle"></div> <div class='pull-right'><?php echo $post_date?></div> </div> <div class='post-body'> <p><?php echo $post;?></p> </div> <div class='post-footer'> <div class='lk-cmt-shr'> </div> <span id='comments'> </span> </div> </div> </div> </li> <?php } } } else { echo '<li>you must <a href="index.php">logged</a> in view ' . $firstname . '\'s posts.</li>'; } ?>
lets add after <?php
these 2 lines , refresh page. can highlight error.
error_reporting(e_all); ini_set('display_errors','on');
Comments
Post a Comment