SQLSTATE[42703]: Undefined column: 7 ERROR: column Alis.column name_column does not exist LINE 1:

Asked

Viewed 690 times

0

I have a page on my system that does a file transfer, it just does an update on the table. I copied the lines of this code and put it to work on another page, changing only the names of fields and table.

I’m using the Symfony 1.4 framework with MVC for PHP development. In the original function action there are two actions one that opens the page and the other that makes the update code. In the action of the other page, I copied the action that makes the page open and the action of the code that makes the update, I changed the name of the fields and table.

My function, as I said, takes the procedure number (original code page) and brings together to whom the procedure was registered. In the database has a Boolean column transferido that gets pattern false and if changed true - and if it is true I say in my code for it to reverse the values.

I did the same thing for the other page. If I didn’t create the column transferido_den (new Boolean column) My button that makes the function of opening the page to download, works all right, but does not change anything because it does not have a column in the table created to receive the value true. If I create the column tansferido_den my system does not load the data and error appears saying that the column does not exist.

My action code is this:

public function executeTransferir(sfWebRequest $request)
{
    $this->forward404Unless(
        $denuncias = Doctrine::getTable('Denuncias')->find(array($request->getParameter('id'))), 
        sprintf('Object denuncias does not exist (%s).', 
        $request->getParameter('id'))
    );

    $this->forward404Unless($this->getUser()->hasPermissionFor('denuncias','editar'), 'Você não possui permissão para executar esta ação!');

    $params = $request->getParameter("denuncias");

    Doctrine_Query::create()
        ->update('denuncias d')
        ->set('d.id_conselho', '?', $params['id_conselho'])
        ->set('d.transferido_den', 'NOT(d.transferido_den)')
        ->where('d.id = ?', $request->getParameter('id'))
        ->execute();

    return $this->renderText('<script>parent.window.location.href = "' . $this->getController()->genUrl('@denuncias') . '";</script>');
} 

I am not the creator of the system, I am only providing maintenance (I am an intern). Can anyone help me?

2 answers

0

try to put a ? as in the line above between the parameters: ->set(’d. transferido_den', '?', 'NOT(d. transferido_den)')

probably work.

  • I think that’s not it, I did it here and the error remains the same. : T

-1


It was giving error because of the database I was calling. There were 2 with similar names, I was creating in db that was not being called in my file, so the error.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.