SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    a DB query problem.. whats going on here?

    ok, so I'm connected to a mysql DB and I know all my table refrences etc are right.. so heres the code:

    PHP Code:
    function v_listvideos($optionalsql) {
    $sql "SELECT * FROM videos ".$optionalsql;
    $res mysql_query($sql);
    echo 
    '<ul>';
    $x 0;
    while(
    $row mysql_fetch_array($resMYSQL_ASSOC)) {
     echo 
    '<div id="t'.$x.'" class="tip"><h2>'.$row['title'].'</h2><h3>'.$row['views'].' total views</h3><p>'.$row['description'].'</p></div>'.
          
    '<li>'.
          
    '<a href="'.$path.$row['title']."_".$row['id'].".html".'" onmouseout="popUp(event,\'t'.$x.'\')" onmouseover="popUp(event,\'t'.$x.'\')"  >'.
          
    '<img src="v_thumbs/'.$row['thumb'].'">'.
          
    '</a>'.
          
    '</li>';
          
    $x++;
     }
    echo 
    '</ul>';
    }

    //

    echo "5 most recent:";
    v_listvideos("ORDER BY -id LIMIT 5");
    echo 
    "5 most popular:";
    v_listvideos("ORDER BY -views LIMIT 5"); 
    for some reason, both echo the same video listing! wtf?

    any help on this one?
    Have a long, ugly URL that will break in emails or IMs?
    Make it a short url!

    learn coin magic tricks!

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo "5 most recent:";
    v_listvideos("ORDER BY -id LIMIT 5");
    echo 
    "5 most popular:";
    v_listvideos("ORDER BY -views LIMIT 5"); 
    Maybe you mean:
    PHP Code:
    echo "5 most recent:";
    v_listvideos("ORDER BY id DESC LIMIT 5");
    echo 
    "5 most popular:";
    v_listvideos("ORDER BY views DESC LIMIT 5"); 

  3. #3
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i guess i do..

    i coulda sworn i had seen it somewhere.

    edit: well, still not helping the problem.

    both are spitting out the same 5 videos.. in same order, even though there are more popular ones!
    Have a long, ugly URL that will break in emails or IMs?
    Make it a short url!

    learn coin magic tricks!

  4. #4
    SitePoint Enthusiast birnam's Avatar
    Join Date
    Oct 2006
    Location
    Kansas City
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any chance that your "views" field is a varchar instead of an integer? If they were being sorted 'alphabetically' instead of numerically, that might explain why the order doesn't seem to make any sense.

    Also, bear in mind that if "id" is an auto_increment field, it won't necessarily give you accurate "most recent" information, as it's possible for an auto_increment field to get reset.
    quality web development at Birnam Designs
    articles and tips for developers at Hunk of, Hunk of Birnam Love

  5. #5
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nope.. views is an integer.

    heres something interesting: when i switch the functions so the most popular is shown first, the second time the function is run (to show the most recent 5) it just spits out the same MOST POPULAR list. so the problem isn't that the lists arent coming from the mysql right, the problem is that it just isnt changing it the second time the function is run.

    any more help/other ideas?
    Have a long, ugly URL that will break in emails or IMs?
    Make it a short url!

    learn coin magic tricks!

  6. #6
    SitePoint Enthusiast birnam's Avatar
    Join Date
    Oct 2006
    Location
    Kansas City
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What happens when you remove the LIMIT? Maybe more data would help identify the problem.
    quality web development at Birnam Designs
    articles and tips for developers at Hunk of, Hunk of Birnam Love

  7. #7
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its just spitting out the same list twice..
    Have a long, ugly URL that will break in emails or IMs?
    Make it a short url!

    learn coin magic tricks!

  8. #8
    SitePoint Enthusiast birnam's Avatar
    Join Date
    Oct 2006
    Location
    Kansas City
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very odd! I tried this with dummy data and used your exact code, and was getting expected results. Can you attach a dump of that database table so I can try with the same data?
    quality web development at Birnam Designs
    articles and tips for developers at Hunk of, Hunk of Birnam Love

  9. #9
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CREATE TABLE `videos` (
    `id` int(11) NOT NULL auto_increment,
    `filename` varchar(20) NOT NULL,
    `slug` varchar(20) NOT NULL,
    `thumb` varchar(50) NOT NULL,
    `title` varchar(50) NOT NULL,
    `description` varchar(150) NOT NULL,
    `views` int(11) NOT NULL default '0',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=76 ;

    --
    -- Dumping data for table `videos`
    --

    INSERT INTO `videos` VALUES (1, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 56);
    INSERT INTO `videos` VALUES (2, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 2);
    INSERT INTO `videos` VALUES (3, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 1);
    INSERT INTO `videos` VALUES (4, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 1);
    INSERT INTO `videos` VALUES (5, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 1);
    INSERT INTO `videos` VALUES (6, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever New', 'this is a new video', 0);
    INSERT INTO `videos` VALUES (7, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever New-er!', 'wow even newer!', 0);
    INSERT INTO `videos` VALUES (8, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (9, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (10, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (11, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (12, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (13, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (14, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (15, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (16, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (17, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (18, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (19, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (20, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (21, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (22, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (23, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (24, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (25, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (26, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (27, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (28, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (29, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (30, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (31, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (32, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (33, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (34, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (35, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (36, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (37, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (38, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (39, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (40, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (41, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (42, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (43, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (44, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (45, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (46, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (47, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (48, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (49, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (50, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (51, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (52, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 28);
    INSERT INTO `videos` VALUES (53, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (54, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (55, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (56, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (57, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (58, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (59, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (60, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (61, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (62, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (63, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (64, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (65, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (66, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (67, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (68, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (69, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (70, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (71, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (72, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (73, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (74, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    INSERT INTO `videos` VALUES (75, 'bestcatchever.wmv', 'best-catch-ever', 'bestcatchever.jpg', 'Best Catch Ever', 'This wide reciever goes pulls off the most insane catch I''ve ever seen!', 14);
    good luck.
    Have a long, ugly URL that will break in emails or IMs?
    Make it a short url!

    learn coin magic tricks!

  10. #10
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works ok for me using your code.
    5 most recent returns rows with id's 75, 74, 73, 72, 71
    5 most popular returns rows with id's 1, 52, 56, 55, 54

    Matches the database exactly : *shrug*

  11. #11
    SitePoint Enthusiast birnam's Avatar
    Join Date
    Oct 2006
    Location
    Kansas City
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also got expected results:

    5 most recent: 75, 74, 73, 72, 71
    5 most popular: 1, 52, 8, 9, 10

    (after #1 (56 views) and #52 (28 views) there are many videos with 14 views so the last three items will vary depending from database to database)

    maybe we're looking in the wrong place.... Try putting an identifier like "echo 'looking in the database: $optionalsql';" in the function above to make sure that's really the function that is being run, and that's it's running the $optionalsql you're expecting it to.
    quality web development at Birnam Designs
    articles and tips for developers at Hunk of, Hunk of Birnam Love

  12. #12
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    agreed. at this point you need to simplify and strip all other code out to help you isolate the isue.


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
  •