___ ___ erkimt SQLSTATE [42703] Undefined column: 7 ERROR: alis.nome_coluna column does not exist LINE 1: [closed] ______ qstntxt ___

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 field and table names.

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

My role, as I said, is to take the procedure number (original code page) and bring it along to whom the procedure was registered. In the database has a boolean column %code% that receives default %code% and if it is changed it becomes %code% - and if it is %code% I say in my code for it to invert the values.

I did the same thing for the other page. If I do not create the column %code% (new boolean column) my button that does the function of opening the page to transfer, everything works fine, however it does not change anything because it does not have a column in the table created to receive the value% with%. If I create the column %code% my system does not load the data and the error appears saying that the column does not exist.

My action code is this:

%pre%

I am not the creator of the system, I am only giving maintenance (I am a trainee). Can anyone help me?

    
______ azszpr57824 ___

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

It will probably work.

    
______ azszpr58125 ___

I was making a mistake 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.

    
___

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 field and table names.

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

My role, as I said, is to take the procedure number (original code page) and bring it along to whom the procedure was registered. In the database has a boolean column transferido that receives default false and if it is changed it becomes true - and if it is true I say in my code for it to invert the values.

I did the same thing for the other page. If I do not create the column transferido_den (new boolean column) my button that does the function of opening the page to transfer, everything works fine, however it does not change anything because it does not have a column in the table created to receive the value% with%. If I create the column true my system does not load the data and the 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 giving maintenance (I am a trainee). Can anyone help me?

    
asked by anonymous 09.04.2015 / 16:15

2 answers

-1

I was making a mistake 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.

    
13.04.2015 / 15:47
0

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

It will probably work.

    
10.04.2015 / 15:52
List by foreign key MySQL and Java ___ ___ Find erkimt values between two prefixes and exchange each other [closed] ______ qstntxt ___

I'm developing an application where you have to find a set value and literally walk 19 homes.

13000000 736363645C736363645F
6178747265653030311300000073
6363645F6178747265653030315F

  • Search for value from: 13000000
  • Floor of: 13000000 up to: 736363645C736363645F617874726565303031 (Or until you find another value 13)

Looking like this:

13000000 736363645C736363645F
617874726565303031 1300000073
6363645F6178747265653030315F

  • Search for another value: 13000000

Looking like this:

13000000736363645C736363645F
617874726565303031 13000000 73
6363645F6178747265653030315F

  • Floor of new value: 13000000 to the other value: 736363645F6178747265653030315F

Looking like this:

13000000736363645C736363645F
61787472656530303113000000 73
6363645F6178747265653030315F

Then, exchange one value for the other: 736363645C736363645F
61787472656530303 for 736363645F6178747265653030315F

Doing a loop by repeating the same function throughout the file.

======================== Edit

So:

13-00-00-00- 73-63-63-64-5C-73-63-63-64-5F-61-78-74-72-65-65-30-30- 31 -13-00-00-00- 73-63-63-64-5F-61-78-74-72-65-65-30-30-31-5F

Looking like this:

13-00-00-00- 73-63-63-64-5F-61-78-74-72-65-65-30-30-31-5F -13-00-00-00- 73-63-63-64-5C-73-63-63-64-5F-61-78-74-72-65-65-30-30-31

NOTE: I changed the value above after the "13-00-00-00" down

============================ @ I tried something similar to this:

%pre%     
______ azszpr140100 ___

A simple way is regular expression, using %code% :

%pre%

In the case, I made you a regular expression with two groups: one internal (to take the 19 values individually) and one external, to get all 19 values at once.

I made a Fiddle .

Note that in Fiddle, %code% is exactly what you're looking for.

About invert to %code% the simple way is to implement this function ( best answer from here ):

%pre%

Therefore:

%pre%

Now I understand what you want. You want to locate the groups two by two, and then invert them.

This changes the regular expression, because you need to necessarily find two groups:

%pre%

Find the largest group ( %code% ) and do another regular expression search on it. You will get two groups.

Just invert them and mount another %code% .

    
______ azszpr140105 ___

I tried to do something that seems to be what you want. You may have problems because the problem is not well defined. If I improve the setting, I can change it a bit and make a final, more organized version. I made a version with question originals and without the dashes as it was after the edit.

%pre%

See working on dotNetFiddle .

    
___