Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Addons

Post Reply
 
Thread Tools
  #1  
Old 06-09-2005, 01:51 AM
tami Offline
pp veteran
 
Join Date: Jun 2005
Posts: 73
random_image.php causes error in mysql, and i don't know why

i'm having a problem getting the random_image.php file to work, and the result is when i mouseover on the link, i see showimage= with no randomly generated number on the end.

when i go to the admin section of pixelpost and load the addons, random_image.php is giving me the following error:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /path/to/pixelpost/addons/random_image.php on line 59
(using v0.2, line 47 using 0.3)

that row is the following:
Code:
   if (list($id,$headline,$image) = mysql_fetch_row($thumbs_ahead)) {
the issue, i believe, is that $thumbs_ahead has no value assigned to it.

Code:
 $thumbs_ahead = mysql_query("select DISTINCT id,headline,image from ".$pixelpost_db_prefix."pixelpost and datetime<='$cdate' order by rand() asc limit 0,$thmb_numb");
looking at the above code, and replicating it in mysql (through the mysql> prompt), generates, naturally, a random entry in my database (by id, headline, and image name).

HOWEVER, in php, i then ran an echo command and tried to output the $thumbs_ahead variable, which resulted in nothing. (blank page, or when i put text there, just the text but not the variable)

i used the same code in the index.php file as well (since it was referred to in the comments for random_image.php). it also doesn't seem to work.

i really am at a loss here as to why this is occurring. here's my setup. does something look wrong here?
PHP-version 4.3.11 (Pixelpost's min requirement: PHP version 4.3.0)
MySQL version 3.23.58 (Pixelpost's min requirement: MySQL 3.23.58)
GD-lib bundled (2.0.28 compatible) with JPEG support
Server software Apache/2.0.52 (Fedora)
EXIF Pixelpost is using exifer v1.5 for EXIF information.

(i emailed this to raminia but it looks like he's busy... if he or anyone has any ideas, please enlighten me!!!!!)
Reply With Quote
  #2  
Old 06-09-2005, 09:34 PM
tami Offline
pp veteran
 
Join Date: Jun 2005
Posts: 73
hmm, nobody has a clue?
Reply With Quote
  #3  
Old 06-09-2005, 10:11 PM
tami Offline
pp veteran
 
Join Date: Jun 2005
Posts: 73
ok this makes no sense to me. i modified a bit of code (new addons and the like) and now the random image actually works. i still get the mysql error when going into the addons page, but i'm not complaining because this thing works.

i'm confused, but i'm glad since it's finally functional!

edit: i wanted to add that this only works with 0.2, not 0.3.
Reply With Quote
  #4  
Old 06-20-2005, 10:43 AM
myeviltwin Offline
pp regular
 
Join Date: Mar 2005
Posts: 22
edit:
nevermind. FIXED IT.
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 06:32 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs