Page 1 of 1

mysql_fetch_array

Posted: Wed Jul 11, 2007 9:30 pm
by wp180
Hello.

If a user or myself edit the genre, everytime a error is coming:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/htdocs/netjukebox/index.php on line 653


regards
Michael

Posted: Thu Jul 12, 2007 12:13 pm
by wbartels
I can't reproduce the error with netjukebox 4.03.
And there is no query on line 653.

Did you use the latest version of netjukebox?

Posted: Thu Jul 12, 2007 12:28 pm
by wp180
Yes, i'm using the 4.03.
But at the moment i see that in the original index.php the error will be in line 652, because i insered one line at the start of the file and some at the end.

If you want i can send you the link to my netjukebox via email.

Posted: Thu Jul 12, 2007 6:12 pm
by wbartels
Please send me the link, than I can check if there is send unexpected post data.

Do you also get the error message when using an unmodified index.php and genre.php script?
Or maybe you could send me the modified index.php script?

Posted: Thu Jul 12, 2007 8:48 pm
by wp180
I also get the error with the original file.

Posted: Thu Jul 12, 2007 11:40 pm
by wbartels
I have now tested it on two different setups, and can't reproduce the problem:

Apache 2.0.59
PHP 4.4.7
MySQL 4.0.27

Apache 2.2
PHP 5.1.6
MySQL 5.0.25a

Do you have a completed other setup?
Do you always get the error when pressing save in "Select genre"?
Did you have the problem in previous versions of netjukebox?

Posted: Thu Jul 12, 2007 11:50 pm
by wbartels
Thanks for the test account.
I don't see any problem with changing a genre.
In what situation did you get the error?

Posted: Fri Jul 13, 2007 12:04 am
by wp180
On my linux system there is running:

Apache 2.0.59
PHP 5.1.6
MySQL 5.0.41

I don't have another setup.
I always get the error. Every time.
And i didn't have the problem in previous versions.

But i didn't install 4.02. I did the update directly from 4.01 to 4.03.

Posted: Fri Jul 13, 2007 12:08 am
by wp180
wbartels wrote:Thanks for the test account.
I don't see any problem with changing a genre.
In what situation did you get the error?

You don't see any problems? mmh. I tried it again, and i get the error every time.

I go for example to (a), take the first artist, click the box and then edit. after saving i get the error.

Posted: Fri Jul 13, 2007 12:11 am
by wbartels
I don't understand it.
With your test account I have changed all album from "die toten hosen" from "punk deutch" to "ska" without any problem.

Posted: Fri Jul 13, 2007 12:14 am
by wbartels
wp180 wrote:
wbartels wrote:Thanks for the test account.
I don't see any problem with changing a genre.
In what situation did you get the error?

You don't see any problems? mmh. I tried it again, and i get the error every time.

I go for example to (a), take the first artist, click the box and then edit. after saving i get the error.
Also changed "a+p" "links-rechts" to "ska" without any problem.

Posted: Fri Jul 13, 2007 12:19 am
by wbartels
Now I can reproduce it.
It only happens when edeting with Firefox.
Also on my own system.

Posted: Fri Jul 13, 2007 12:28 am
by wp180
I tried it with the internet explorer at the moment. There it is no problem. :-)
But i know that under Mac with Safari there is the problem too.

Posted: Fri Jul 13, 2007 12:51 am
by wbartels
I found the problem, In JavaScript location you may not escape & in &

To fix it change code block 156-161 in genre.php from:

Code: Select all

$url = 'index.php?action=view2';
$url.= ($artist == '') ? '&genre_id=' . rawurlencode($genre_id) : '&artist=' . rawurlencode($artist);
$url.= '&order=' . rawurlencode($order);
$url.= '&sort=' . rawurlencode($sort);
echo '<script type="text/javascript">window.location="' . $url . '";</script>';
exit();
to:

Code: Select all

$url = 'index.php?action=view2';
$url.= ($artist == '') ? '&genre_id=' . rawurlencode($genre_id) : '&artist=' . rawurlencode($artist);
$url.= '&order=' . rawurlencode($order);
$url.= '&sort=' . rawurlencode($sort);
echo '<script type="text/javascript">window.location="' . $url . '";</script>';
exit();
I will come up shortly with a fixed version of netjukebox.

Posted: Fri Jul 13, 2007 11:32 am
by wp180
I tested it. It works very good. :-) Also under Mac Safari.

Thanks for helping.

Micha