Skip to main content
Inspiring
February 2, 2013
Question

Table doesn't exist

  • February 2, 2013
  • 1 reply
  • 2404 views

I'm working on this page and I can't figure out why I keep getting the error:

Error Executing Database Query.

General error: Table 'mymindsnotrighttest.notifylist' doesn't exist

The thing is, the page loads on my testing server but not when I put it online.  (On the testing server, the cfmail isn't functional but I know it's not supposed to be).  I'm aware I have the 'notifylist' cfquery twice, but it doesn't work when it's just one or the other.

this is some of the code I've been working with.  Any help would be very much appreciated.  Thanks. - Mike

==========================================================================================

<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>

<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">

  <cfquery datasource="mymindsnotrighttest" password="Mex0Wix0" username="mikewycklendt">  

    INSERT INTO boardtopics (post_id, board_id, user_id, username, title, content, date)

VALUES (<cfif IsDefined("FORM.post_id") AND #FORM.post_id# NEQ "">

<cfqueryparam value="#FORM.post_id#" cfsqltype="cf_sql_numeric">

<cfelse>

NULL

</cfif>

, <cfif IsDefined("FORM.board_id") AND #FORM.board_id# NEQ "">

<cfqueryparam value="#FORM.board_id#" cfsqltype="cf_sql_numeric">

<cfelse>

NULL

</cfif>

, <cfif IsDefined("FORM.user_id") AND #FORM.user_id# NEQ "">

<cfqueryparam value="#FORM.user_id#" cfsqltype="cf_sql_numeric">

<cfelse>

NULL

</cfif>

, <cfif IsDefined("FORM.username") AND #FORM.username# NEQ "">

<cfqueryparam value="#FORM.username#" cfsqltype="cf_sql_clob" maxlength="65535">

<cfelse>

''

</cfif>

, <cfif IsDefined("FORM.title") AND #FORM.title# NEQ "">

<cfqueryparam value="#FORM.title#" cfsqltype="cf_sql_clob" maxlength="65535">

<cfelse>

''

</cfif>

, <cfif IsDefined("FORM.content") AND #FORM.content# NEQ "">

<cfqueryparam value="#FORM.content#" cfsqltype="cf_sql_clob" maxlength="2147483647">

<cfelse>

''

</cfif>

, <cfif IsDefined("FORM.date") AND #FORM.date# NEQ "">

<cfqueryparam value="#FORM.date#" cfsqltype="cf_sql_timestamp">

<cfelse>

NULL

</cfif>

)

<cfquery name="rsNotifyList" datasource="mymindsnotrighttest" username="mikewycklendt" password="Mex0Wix0">

SELECT *

FROM notifylist

</cfquery>

<cfmail

        TO="<cfoutput query=rsNotifyList>#rsNotifyList.email#, </cfoutput>"

        from="MyMindsNotRight@mymindsnotright.com"

        subject="New Post Just For Me"

        server="scriptmail.intermedia.net" 

        >

#FORM.username# has made a new post:

==================================================

#FORM.title#

--------------------------------------------------

#FORM.content#

-------------------------------------------------

You can see the full discussion by clicking this link:

http://www.mymindsnotright.com/discussionGenReplies.cfm?post_id=#FORM.post_id#

  </cfmail>

  </cfquery>

  <cflocation url="discussionGenReplies.cfm?post_id=#post_id#">

</cfif>

<cfquery name="Recordset1" datasource="mymindsnotrighttest" username="mikewycklendt" password="Mex0Wix0">

SELECT *

FROM boardtopics

WHERE board_id = 1

ORDER BY post_id DESC

</cfquery>

<cfquery name="rsRepliesNumber" datasource="mymindsnotrighttest" username="mikewycklendt" password="Mex0Wix0">

SELECT *

FROM board_replies

WHERE board_id = 1

</cfquery>

<cfquery name="rsTopicRecordCount" datasource="mymindsnotrighttest" username="mikewycklendt" password="Mex0Wix0">

SELECT *

FROM boardtopics

</cfquery>

<cfquery name="rsNotifyList" datasource="mymindsnotrighttest" username="mikewycklendt" password="Mex0Wix0">

SELECT *

FROM notifylist

</cfquery>

    This topic has been closed for replies.

    1 reply

    BreakawayPaul
    Inspiring
    February 2, 2013

    In your actual code, do you really have a <cfquery> inside another <cfquery>, or was that a pasting accident?

    Also, as a side note, those four last queries could probably be combined into one, using JOINs.

    wycksAuthor
    Inspiring
    February 2, 2013

    That was my actual code... which part of the code are you referring to?  Thanks for the quick reply - Mike

    BreakawayPaul
    Inspiring
    February 2, 2013

    Your "INSERT INTO boardtopics" query tag (which has no name="" attribute) is still open when you start your "<cfquery name="rsNotifyList" query, and doesn't close until after the </cfmail> close.  AFAIK, nesting cfquery tags is not allowed.