Results 1 to 3 of 3

Thread: Not Showing All Results

  1. #1
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Not Showing All Results

    I have a script that is simply supposed to show all links in the database. For some reason, it does not show the newest link in the table. Here is my code:
    PHP Code:
    <?php

    $level 
    $_SESSION['level'];

    ########## If No Action ##########
    if (!$_GET['act'] && !$_POST['delete']) {
        if (
    $level 1) { die('<meta http-equiv="refresh" content="2;URL=index.php" /> <div class="error">You do not have permission to access this page</div>'); } else {
            
    $get mysql_query("SELECT * FROM `links` ORDER BY id DESC") or die ("Error Getting Users! \n<br />\n" .mysql_error());
            
    $u mysql_fetch_array($get);
            
    $chk mysql_num_rows($get);
            
        
    // If No Resuts
        
    if ($chk 1) { echo('No links at this time.'); } else { $count 1$color $col1?>
        
        <b>Navigation:</b> <a href="add.php">Add New Link</a> <br />
            <form method="post" action="<?php echo $_SERVER['PHP_SELF'?>">
                <table width="500" align="center" class="admin_table">
                    <tr bgcolor="<?php echo $col3 ?>">
                        <td>ID</td>
                        <td>Title</td>
                        <td>URL</td>
                        <td>View Level</td>
                        <td>Edit</td>
                        <td>Delete</td>
                    </tr>
        <?php while ($u mysql_fetch_array($get)) { $l parse_url($u['url']); ?>
                    <tr bgcolor="<?php echo $color ?>">
                        <td><?php echo $u['id'?></td>
                        <td><?php echo $u['title'?></a></td>
                        <td><a href="<?php echo $u['url'?>" target="_blank"><?php echo $l[path?></a></td>
                        <td><?php echo $u['viewLvl'?></td>
                        <td><a href="?act=edit&amp;id=<?php echo $u['id'?>"><img src="../../images/edit.png" alt="Edit" border="0" /></a></td> 
                        <td><input type="checkbox" name="checkbox[]" value="<?php echo $u['id'?>" /></td>
                    </tr>
        <?php ++$count; if ($color == $col1) { $color $col2; } else {$color $col1; }  
        } 
    ?>
                </table>
            </form>
        
        <?php
        
    }
        }
    }
    ?>
    I don't see anything that should cause this. Anyone know what is going wrong? Thanks
    Thanks DD, you saved me countless times

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    $count = 1; should be $count = 0;
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by tech_support View Post
    $count = 1; should be $count = 0;
    That doesn't seem to be the problem. That code is for the row colors and not for the results display. I did try changing it to 0 and got no change. Any other ideas?

    I found that when I add a pagination script and limit 1 result to each page, it will not show any results on a page, but it will have a page link for the correct amount of results.
    Last edited by Titan85; 08-21-2007 at 12:45 PM.
    Thanks DD, you saved me countless times

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •