Skip navigation
Currently Being Moderated

Problem with sample forum script?

Jul 18, 2009 6:32 AM

Hi all,

I am having a problem with the "create a forum" tutorial.

The rest of the forum works okay but when i go to post a message i fill in the form and get the following error:

SQL error: Column 'idtop_msg' cannot be null.
SQL error: INSERT INTO forum_message_msg (idtop_msg, idusr_msg, date_msg, subject_msg, content_msg, subscribe_msg) values (null, null, null, 'here we go again', 'lets try this one more time shall we?', 1). (SQL_ERROR)
tNG Execution Trace - VIEW
  • tNG_insert.executeTransaction
    • STARTER.Trigger_Default_Starter
    • tNG_insert.doTransaction
      • BEFORE.Trigger_Default_FormValidation
      • tNG_insert.prepareSQL
      • tNG_insert.executeTransaction - execute sql*
      • ERROR.Trigger_Default_Insert_RollBack
  • tNG_insert.getRecordset
  • tNG_insert.getFakeRsArr
  • tNG_insert.getLocalRecordset
  • tNG_insert.getFakeRecordset
  • tNG_insert.getFakeRecordset


I've been through the tutorial a few times to find where i went wrong but can't find anything.  I have also googled the problem and come up empty.  If anyone could please help with this it would be much appreciated.  I get that the idtop_msg isn't getting a value on the post message page but can't understand why not.



  • Currently Being Moderated
    Jul 21, 2009 9:24 AM   in reply to dKazza

    Where's the create forum tutorial you are mentioning? It might help others help you if they knew the steps you've taken to get where you're at...

    Mark as:
  • Currently Being Moderated
    Jul 31, 2009 6:57 AM   in reply to dKazza

    This may be too simple of an answer but here are the first things to check:


    The error is telling you that the idtop_msg is NULL or empty.


    Without reading the tutorial, the deal is only one of a few things. Either you didn’t set the database to auto increment that column (creating its own id)

    Or you were supposed to have carried that id  from the database to an hidden field, or URL or a field on a previous page… or somewhere that it could be referenced again. When you POST that Id is not present somwhere on  your page and  so it gets a NULL value.


    If all of that is right and you know the id is present on the page...then you need to check your insert/update configuration, you may have one of the SQL varibles marked incorrectly   or one of those sneaky cut aand paste feilds renamed itself to  xxx2  ...grrr. 


    There’s nothing majorly complicated in that tutorial so I think you’ll find that if you track back your steps, you’ll see that id is not being carried from one of the three placed I mentioned.


    I hope this helps.


    Cheers- Good luck.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points