Database Query Error Database Query Error
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Database Query Error

Started by rphMedia, January 23, 2005, 01:11:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rphMedia

Hi,

I must've broke something and I hope you can help me out.  I wanted to upload some videos for "registered users" only.  So I went into Admin and upgraded registered user accounts (mine) to allow larger uploads.  I changed the max from 1024kb to 10,000kb.  When I logged out, I got a "database query error".  I tried to change it back (to 1024KB), but the error still persists.

I've enabled debug mode for you, but I can't understand what the error is telling me.  I tried to do a database update to no avail.  I hope that it's something simple I'm missing and a quick fix.  Here is the site and the errror -

*removed old link

Thanks!

kegobeer

Did you enter 10,000 or 10000?

Use phpMyAdmin and look at your _usergroups table.  You can change the group_quota that way.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

rphMedia

Well, I didn't have phpMyAdmin installed, so I figured it was about time, so I got it all installed and configured....

There's nothing wrong (as far as I can see) with the database structure.  I changed the disk quota to 20megs (20000) and the upload quota back to 1024 and those figures are in there correctly.  I didn't modify any files manually.  I simply went in and changed the upload max to 10000 and the disk quota to, I think, 50000 at the time. But, like I said, I changed everything back to the way it was and I still have that error?  I'm lost. Any troubleshooting tips would be great. Thanks.

Joachim Müller

The error message is
QuoteWhile executing query "SELECT aid FROM cpg132_albums as a WHERE category>=10000 and AND a.aid NOT IN (14) " on 0

mySQL error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND a.aid NOT IN (14)' at line 1
Not sure what's wrong though.

Joachim

rphMedia

#4
Well, this is a wild guess, but I'm thinking that 1 of my files just simply became corrupted.  I think I'm going to start replacing files one by one.  Everything else works.  It appears it's in index.php, because thumbnail, displayimage, logins etc, still work fine.  I'll report my findings if solved before any addtional tips.

edit - that double 'and AND' doesn't look right, hope I'm close here.  replaced index.php to no avail.

rphMedia

If I login (as any user, including Admin), everything's fine at the start/home page.

rphMedia

Well, I solved it.  In the process of getting ready to upload a couple of videos, I decided to make these videos only visible by registered users.  So, as a user (not admin) I created an album and modified it so that only registered users could view this particular album. THIS caused the error at the home start page.

Is this normal?  I can't make albums private to registered ussers only?

Or do I have other problems? 

rphMedia


Joachim Müller

This shouldn't be breaking the database query. Did you accomplish your setup using coppermine's user interface or did you modify the code?

Joachim

rphMedia

Hi Joachim,

I'm using Coppermine's user interface exclusively.  I first went to Groups and made sure that registered users could have Private Albums.  Then, I log in as a user, make an album, modify the album to make it "only me" or "registered users only", logout and this is when I get my Db error (only thru index, the other pages work fine). Conversely, if I login as any user, the error goes away. 

I'll set you up a test user account if you think it would help.

Joachim Müller

yes, please: PM me an admin account, together with a link to your site and a link to this thread for reference.

Joachim

Joachim Müller

I was able to log in (using the admin account you PMed me), but I was not able to replicate the error. Please post instructions how to do so (either an absoulte url or the steps you take to see the error).
Your page is heavily modified, I'm not sure it will be easy to spot what actually goes wrong.

Joachim

rphMedia

OK, I made you a registered user and created a test album.  Go in (same credentials) and modify the album to "me only" or "registered" only to view.  You'll see the error on logout.  Thanks again.  I'll be around for a while in case you need me to make any other changes (back to admin or whatever).  Thanks again!

Joachim Müller

OK, now I was able to replicate this on your page as well. Doing exactly the same thing on my cpg1.3.2 test install didn't bring up this error though, so my guess is that this is related to the various hacks you applied on your page - not sure what to recommend except to undo your changes and get the most recent files from the stable branch of the cvs... Sorry.

Joachim

rphMedia

Well, I have some work to do then  ;D (did you notice that if you login as the user, the error goes away?... so I'm sure it has to do with permissions somewhere).

I removed "my personal" hacks - only anycontent mods.  Doesn't seem to affect anything, though.  Just for info in case anyone else runs across this, the hacks I've applied are -

"Who's online"
"Send this Album to a friend" - could be culprit
"Preview E-Card"
"Newsletter"
"Date & Time of upload"

I also have the indexing of text links, but this is a separate page altogether. And of course some css changes, but I'm sure that this has nothing to do with it.  

Thanks for confirming and looking at it for me.  It's really no big deal for now as this is a family gallery and don't really require any private albums.


nol33t

just a wild guess..i was reading code from your flashthumb.php file to try to help someone on the french board to implement your "Image Scroller based on FilmStrip" mod, and i found that line 5:


if ($FORBIDDEN_SET != "") $FORBIDDEN_SET = "AND $FORBIDDEN_SET";


that could be your problem..;)

rphMedia

Nope, that's an "anycontent" mod only.  These were removed for troubleshooting and we still get the error. Thanks for the tip though.

Nibbler

Early versions of my lastest uploads mod had that issue, caused by use of the code posted by nol33t.

rphMedia

Nibbler, which mod are you speaking of.  Don't think I have it.