Undefined Constant?
 
Notifications
Clear all

Undefined Constant?

5 Posts
3 Users
0 Reactions
2,096 Views
(@guest2449)
Posts: 0
 

URL to your eFiction: http://loveontherun.dramatic-personae.net/fiction/eFiction35/
Version of eFiction: 3.5
Have you bridged eFiction, if so with what?: I'm not sure what that is, so I'm going to assume I haven't?
Version of PHP: php5
Version of MySQL: 5.0
Have you searched for your problem: No, but only because I don't even know what to begin to start with.
If so, what terms did you try: <above>
State the nature of your problem: The preview works for posting a new story but when you hit 'submit' this comes up:
Notice: Use of undefined constant PENNAMEFIELD - assumed 'PENNAMEFIELD' in /home/.odysseus/loveontherun/loveontherun.dramatic-personae.net/fiction/eFiction35/stories.php on line 295

Notice: Use of undefined constant DBPREFIX - assumed 'DBPREFIX' in /home/.odysseus/loveontherun/loveontherun.dramatic-personae.net/fiction/eFiction35/stories.php on line 295

Notice: Use of undefined constant UIDFIELD - assumed 'UIDFIELD' in /home/.odysseus/loveontherun/loveontherun.dramatic-personae.net/fiction/eFiction35/stories.php on line 295
A fatal MySQL error was encountered.
Query: SELECT PENNAMEFIELD AS penname FROM DBPREFIXfanfiction_coauthors AS c WHERE sid = '5' LEFT JOIN fanfiction_authors as author AS a ON a.UIDFIELD = c.uid
Error: (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 'LEFT JOIN fanfiction_authors as author AS a ON a.UIDFIELD = c.uid' at line 1

However, when you go back to the home page or browse, the submitted story shows up as posted.
Do you have a test account for us? Again, not totally sure what that means...


 
Posted : 01/04/2009 10:40 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

There are four lines in stories.php that need to be replaced.

Find lines 295, 309, 713, and 727.  They look like this:


$coQuery = dbquery("SELECT ".PENNAMEFIELD." AS penname FROM ".DBPREFIX."fanfiction_coauthors AS c WHERE sid = '$sid' LEFT JOIN "._AUTHORTABLE." AS a ON a.".UIDFIELD." = c.uid");

Replace them with this:


$coQuery = dbquery("SELECT "._PENNAMEFIELD." AS penname FROM ".TABLEPREFIX."fanfiction_coauthors AS c LEFT JOIN "._AUTHORTABLE." ON "._UIDFIELD." = c.uid WHERE sid = '$sid'");

For tips on searching, you should try running part of the error message - just leave out anything that is specific to your site, such as the first part of the file path (ie .odysseus/loveontherun/...) since this is unique to your site and will ruin the search. (You may also consider in the future leaving that out or putting *** instead, as it can be helpful to hackers.) Actually, this problem is so common that just browsing the most recent posts on almost any of the 3.0 boards will give you a thread that deals with it.


 
Posted : 01/04/2009 10:53 pm
(@guest2449)
Posts: 0
 

Okay one question: how do I search in and edit a .php file?


 
Posted : 02/04/2009 12:34 am
(@becca)
Posts: 553
Honorable Member
 

For starters, use a basic text editor such as MS Notepad, not MS Wordpad or MS Word. Or you can download a free coding text editor such as EditPad Light or Notepad++.


 
Posted : 02/04/2009 2:27 am
(@guest2449)
Posts: 0
 

Great - that worked perfectly. Thank you!


 
Posted : 02/04/2009 3:36 am
Share: