Posted on: 05/18/04 06:49am
By: destr0yr
as site admin, i am able to edit any and all journal entries, however, users that own their journals see a white screen that reads "SQL error - please see error.log for details". In error.log, I see the following:
Tue May 18 03:42:39 2004 - 1064: 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 '' at line 1. SQL in question: SELECT jrn_uid FROM gl_journal WHERE jrn_id =
Anybody have a suggestion on how this could be fixed?
journal SQL error - users unable to edit previous posts
Posted on: 05/18/04 11:17pm
By: destr0yr
*thinking out loud*
from what I can see, since the url the user is going /journal/index.php?mode=edit&type=entry&je_id=20040518032829627
sooo, since type=entry, thats true... so we go over to shownavigation and then editjournalentry($je_id). from what i understand, $je_id would = 20040518032829627 if we use the url above.
case 'edit':
if ($type == 'entry') {
$display .= shownavigation($mode,$cur_journal);
$display .= editjournalentry($je_id);
over to editjournalentry in functions.inc, the first few lines...
if( ownsjournal( $jrn_id ) )
soo, that would call ownsjournal ( $jrn_id ), right? But how does it know what $jrn_id is, it wasn't passed in the previous call or in the URL? anyways...
$result = DB_query("SELECT jrn_uid FROM {$_TABLES['journal']} WHERE jrn_id = $jrn_id");
$A = DB_fetchArray($result);
if( $_USER["uid"] == $A["jrn_uid"] )
sooo, not knowing how $jrn_id gets here. from the SQL error in my previous post its almost like it doesn't? help? please
journal SQL error - users unable to edit previous posts
Posted on: 05/20/04 07:50am
By: Anonymous (craig)
can you throw in a "print $jrn_id;" and see what you get?
it;s either null, of contains a single quote
journal SQL error - users unable to edit previous posts
Posted on: 05/20/04 07:20pm
By: destr0yr
[QUOTE BY= craig] can you throw in a "print $jrn_id;" and see what you get?
it;s either null, of contains a single quote [/QUOTE]
it contains the proper jrn_id, which is frustrating me even more.
Can nobody else help me with this?
journal SQL error - users unable to edit previous posts
Posted on: 05/20/04 07:43pm
By: destr0yr
hmm
thats wack. i fixed it...
in /path/to/geeklog/plugins/journal/functions.inc, i changed the following (~ line 736) from:
$result = DB_query("SELECT jrn_uid FROM {$_TABLES['journal']} WHERE jrn_id = $jrn_id");
to
$result = DB_query("SELECT jrn_uid FROM {$_TABLES['journal']} WHERE jrn_uid = {$_USER['uid']}");
i just hope it doesn't negatively effect anything else.