Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Table 'tinsdirect.GDN_' doesn't exist (missing table name)

zodiacdmzodiacdm
edited September 2011 in Vanilla 2.0 - 2.8
This is not the first time I ran into this problem, and I'd rather not just update the database manually if the functionality is already built into the form class.

My model class ( ProjectModel ) has the same name as the table ( GDN_Project ) in the database, with the exception of having 'Model' at the end of it.

I even declared the table name in the parent::__construct('Project')

There is no save function in my model, I am trying to use the one that is built into the Gdn_Model class.

Any suggestions would be appreciated.

Best Answer

  • UnderDogUnderDog MVP
    Answer ✓
    One suggestion is to explain what you would like to achieve please.
    Then explain which query you want to execute and after that explain the exact error message you receive.
    It has probably something to do with the table prefix though.

    There was an error rendering this rich post.

Answers

  • UnderDogUnderDog MVP
    Answer ✓
    One suggestion is to explain what you would like to achieve please.
    Then explain which query you want to execute and after that explain the exact error message you receive.
    It has probably something to do with the table prefix though.

    There was an error rendering this rich post.

  • well, what I am trying to do here is rather simple.

    I am adding a one-line message to the database.

    here is the code I have

    Controller function:
    public function Text() { $this->PrepareController(); $this->AddModule(GalleryModule); $this->AddModule(GallerySideModule); // Replaced by public $Uses variable //$this->Form = new Gdn_Form('Project'); $this->Form->SetModel($this->ProjectModel); $ProjectData = $this->ProjectModel->GetCurrent(Gdn::Session()->UserID); echo $ProjectData->ProjectKey; $this->Form->AddHidden('ProjectKey', $ProjectData->ProjectKey); if ($this->Form->AuthenticatedPostBack()) { if ($this->Form->Save()) { $this->StatusMessage = T("Your changes have been saved successfully."); //$this->RedirectUrl = Url('/item/'.$Item->Slug); } else { $FormValues = $this->Form->FormValues(); $this->ProjectModel->Update('Project', array( 'Message', $FormValues['Message'] ), array('ProjectKey' => $ProjectData->ProjectKey)); } } else { $this->StatusMessage = T("Your changes have NOT been saved successfully."); } $this->Render(); }

    and here is the view file:

    echo $this->Form->Open(); echo $this->Form->Errors(); echo $this->Form->TextBox('Message'); echo $this->Form->Close('Save');


Sign In or Register to comment.