php - sql statement or while loop drawing a blank -
my code below should populating list of 7 items, nothing showing up. can tell me error is, maybe in sql statement? thanks
<?php $page_title = 'view sites'; include ('includes/header.html'); include ('includes/functions.php'); include ('includes/config.inc.php'); if (isset($_get['id']) && is_numeric($_get['id'])){ $id = $_get['id']; } elseif (isset($_post['id']) && is_numeric($_post['id'])) { $id = $_post['id']; } else { echo '<p class="error">this page has been accessed in error.</p>'; include ('includes/footer.html'); exit(); } if (isset($_session['userid'])){ require (mysql); $w = "select s.sitetypeid, s.sitetype, u.url sitetypes s left join sites u using (sitetypeid) userid=$id"; $k = mysqli_query($dbc, $w)or trigger_error("query: $w\n<br />mysqli error: " . mysqli_error($dbc)); if (mysqli_num_rows($k) == 1){ while ($row33 = mysqli_fetch_array($k, mysqli_assoc)){ echo '<table border="0"><th>site type</th><th>url</th><tr><td>' . $row33['sitetype'] . '</td><td>' . $row33['url'] .'</td></tr>'; } echo '</table>'; } } include ('includes/footer.html'); ?>
Comments
Post a Comment