Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorcardoso
    • CommentTimeNov 7th 2005
     
    Hi, I get a mysql error but pictures still display. Here the page where it shows up: http://www.lab11.evideohosting.ca/foto/index.php?level=album&id=4

    Thanks a million
    Nelson
    • CommentAuthorcardoso
    • CommentTimeNov 7th 2005
     
    btw... this is line 363: $num_items = mysql_result($result, 'num_items');
    • CommentAuthorcardoso
    • CommentTimeNov 7th 2005
     
    Hi again, this is where i'm getting my problem:

    elseif ($level == "album") {
    // Album level display mode (display all pictures within album)
    $output .= '<input type="hidden" name="dl_type" value="pictures" />';
    $count_sql = "SELECT COUNT(*) AS num_items FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = '$id'";
    $result = mysql_query($count_sql);
    $num_items = mysql_result($result, 'num_items');
    $num = $num_items;



    The error is:

    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/lab11/public_html/foto/gallery.php on line 363


    This is line 363:
    $num_items = mysql_result

    This is what shows up:
    http://www.lab11.evideohosting.ca/foto/index.php?level=album&id=4

    Thanks
    • CommentAuthorddejong
    • CommentTimeNov 7th 2005
     
    I would check with Mike, but I think it's possible that the mySQL database can fail, but the thumbs and images can still be retreived because they themselves are kept in the filesystem, not the database.

    Put in "echo mysql_error();" before and after line 363, and see what additional info it spits out. Post it here as well, if you'd like. My hope is that it will say something like "failed to connect to table 'plogger_pictures'", a login failure, or that there were no results found; just something more to go on than $result is null (the only option if it's not a mySQL resource, I think).

    Regards,
    Derek
    •  
      CommentAuthormike
    • CommentTimeNov 7th 2005
     
    This is strange, not sure why you get the error on your installation (with the same server setup) and it doesn't appear elsewhere.

    I guess you could try this alternate, equivalent code:

    $output .= '<input type="hidden" name="dl_type" value="pictures" />';
    $count_sql = "SELECT id FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = '$id'";
    $result = mysql_query($count_sql);
    $num_items = mysql_num_rows($result);
    $num = $num_items;

    Let me know if that changes anything.
    • CommentAuthorcardoso
    • CommentTimeNov 7th 2005
     
    Thanks so much for the help.

    I commented out the existing code and now I get this:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lab11/public_html/foto/gallery.php on line 369


    I'm going to change it back...
    here's the page where it happens:
    http://www.lab11.evideohosting.ca/foto/index.php?level=album&id=5

    What does that chunk do anyway? Can it be commented out?

    Thanks a million
    Nelson
    • CommentAuthorcardoso
    • CommentTimeNov 8th 2005
     
    Hi,

    What does that chunck of code do by the way? I cemmented it out and the error is gone and the album still seems to work. Can I leave it out without causing damage?

    ex:
    // Album level display mode (display all pictures within album)
    $output .= '<input type="hidden" name="dl_type" value="pictures" />';
    //$count_sql = "SELECT COUNT(*) AS num_items FROM `".$TABLE_PREFIX."pictures` WHERE parent_album = '$id'";
    //$result = mysql_query($count_sql);
    //$num_items = mysql_result($result, 'num_items');
    //$num = $num_items;

    Thanks
    Nelson
    •  
      CommentAuthormike
    • CommentTimeNov 8th 2005 edited
     
    I think that variable $num, or $num_items, is passed to the generate_pagination function later on in the script. In other words, the code determines how many albums are in the collection and the variable is used to determine how many pages of content can be generated along with the corresponding page links.

    As long as your amount of albums doesn't exceed your "number of thumbnails per page" option variable, there should be no deteriment. Having more will cause problems though, the pagination won't work properly.

    I think there may be a better solution for this.
    • CommentAuthorcardoso
    • CommentTimeNov 8th 2005
     
    Hi Mike or anyone else... I ran into that limitation you mentioned in the last post... any other pointers? Thanks a million.

    Nelson
    •  
      CommentAuthormike
    • CommentTimeNov 8th 2005
     
    Did you try Derek's suggestion?

    Put in "echo mysql_error();" before and after line 363, and see what additional info it spits out.
    • CommentAuthorcardoso
    • CommentTimeNov 8th 2005
     
    One interesting thing... when I ran the install, I got the folowwing message:
    "Plogger has already been installed!"

    This was before I installed it the first time. So I over-road the if statement that forces that comment so that I could get to the install wizzard.

    Just a little while ago, I tried installing the code on a whole other server and got the same message. Why am I getting this message? and did I perhaps screw something up when I by-passed what brings up that message?

    I also noticed that the "PREFIX" doesn't get the right db name... if you look at the code mysql_error(); brings up... it shows the following:

    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/lab11/public_html/foto/gallery.php on line 366
    Table 'lab11_main.plogger_pictures' doesn't exist

    (see here: http://www.lab11.evideohosting.ca/foto/index.php?level=album&id=6)

    This is very interesting because the plogger tables are under a db called "lab11_foto" and not "lab11_main". I do have a lab11_main db but that's not where the plogger tables are.

    Does this all mean anything to anyone? Do you see something I've missed.

    Thanks a million to everyone that's helped so far... I appreciate the effort a lot!!!

    Nelson
    • CommentAuthorddejong
    • CommentTimeNov 8th 2005
     
    There should be a file called "plogger-config.php". Make sure you set your mysql variables in there manually. Don't know why or if it matters, but plogger left them blank after my install. I filled them in because opening the file, it seemed like a good idea. I tend not to read instructions, so I can't remember if this is suggested for Plogger.. :)

    Let us know if that helps,
    Derek
    • CommentAuthorcardoso
    • CommentTimeNov 8th 2005
     
    Hi Derek,

    I have a plog-config.php. Is this what you mean (connection info)? If it is, I filled it out. I'm really pulling out my hair here (and my head is shaved... that's hard to do). Anything else anyone can think of?

    Thanks a million.

    Nelson
    •  
      CommentAuthormike
    • CommentTimeNov 8th 2005
     
    Plogger fills in that information (plog-config.php) for you automatically, you shouldn't need to edit that file ever...
    • CommentAuthorcardoso
    • CommentTimeNov 8th 2005
     
    You'll guys will never beleive what I've gone through with this thing!!! I'm now pretty sure it was a "brain freeze" by my database. So here's how I stepped around the problem. I created a new connection right above that chunk of code and then calculated the "$result" using the new connection. Now it works fine.

    Wow... I broke a sweat! Guys, you're probably all cringing at my "most likely" bad coding... but at this point I'm just happy it's working!

    Thanks so much for all the help. You guys are all great!

    Here's the final result: http://www.lab11.evideohosting.ca/foto/index.php?level=collection&id=1

    Regards
    Nelson
    •  
      CommentAuthormike
    • CommentTimeNov 9th 2005
     
    Great! Hack it till it works :) Nothin' wrong with that, look at Windows for instance :)
    • CommentAuthortyoung
    • CommentTimeJul 25th 2006
     
    I know this is an old issue, but it's excatly the problem I'm having. Should this have been resolved in later updates?