Irresistable Posted November 16, 2009 Share Posted November 16, 2009 I have pagination which should display all the Users along with there Email, and Admin status. When testing the code, I recieve no errors, but the table does not load with the details. (It's just blank, like there is nothing in the database) <?php case 'admin': if($admin == 1) { echo '<p> WARNING - This is the Admin Center, take extra care when modifying</p><br />'; require_once ("Pagination/Paginated.php"); require_once ("Pagination/DoubleBarLayout.php"); $us = mysql_query("SELECT Username FROM Users WHERE Username")or die(mysql_error()); $names = mysql_fetch_array($us); $em = mysql_query("SELECT Email FROM Users WHERE Username")or die(mysql_error()); $emails = mysql_fetch_array($em); $ad = mysql_query("SELECT Admin FROM Users WHERE Username")or die(mysql_error()); $admins = mysql_fetch_array($ad); $page = $_GET['page']; //constructor takes three parameters //1. array to be paged //2. number of results per page (optional parameter. Default is 10) //3. the current page (optional parameter. Default is 1) $pagedResults = new Paginated($names, 10, $page); $pagedResults1 = new Paginated($emails, 10, $page); $pagedResults2 = new Paginated($admins, 10, $page); echo '<table width="200" border="1">'; while($row = $pagedResults->fetchPagedRow() & $row1 = $pagedResults1->fetchPagedRow() & $row2 = $pagedResults2->fetchPagedRow()) { //when $row is false loop terminates echo '<tr><td>'.$row.'</td><td>'.$row1.'</td><td>'.$row2.'</td></tr>'; } echo '</table>'; //important to set the strategy to be used before a call to fetchPagedNavigation $pagedResults->setLayout(new DoubleBarLayout()); $pagedResults1->setLayout(new DoubleBarLayout()); $pagedResults2->setLayout(new DoubleBarLayout()); echo $pagedResults->fetchPagedNavigation(); echo $pagedResults1->fetchPagedNavigation(); echo $pagedResults2->fetchPagedNavigation(); ?> Link to comment https://forums.phpfreaks.com/topic/181748-does-not-display-username-email-and-admin-values-in-table/ Share on other sites More sharing options...
Irresistable Posted November 16, 2009 Author Share Posted November 16, 2009 Changed the queries to.. $us = mysql_query("SELECT Username FROM Users")or die(mysql_error()); $emails = mysql_fetch_array($us); $em = mysql_query("SELECT Email FROM Users")or die(mysql_error()); $emails = mysql_fetch_array($em); $ad = mysql_query("SELECT Admin FROM Users")or die(mysql_error()); $admins = mysql_fetch_array($ad); Though.. still doesn't recieve a value from the database. Link to comment https://forums.phpfreaks.com/topic/181748-does-not-display-username-email-and-admin-values-in-table/#findComment-958596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.