I'm using a generic CRUD developed by William F. Leite and it caters very well, but I'm having a hard time making a change, I tried some possibilities but without success, what I have is this:
// INSTANCIO A TABELA $crud = Crud::getInstance($pdo, 'ubsSeq'); // BUSCO A ÚLTIMA SEQUÊNCIA DA TABELA $sqlSeq = "SELECT max(valor) AS Sequencia FROM ubsSeq WHERE nome = 'seq_laudo'"; $arrayParamSeq = array(); $ResSeq = $crud->getSQLGeneric($sqlSeq, $arrayParamSeq, TRUE); foreach ($ResSeq as $Seq) { // ATRIBUO + 1 A SEQUÊNCIA RESGATADA $Seq = $Seq->Sequencia + 1; // AQUI ALTERO O VALOR DA SEQUÊNCIA $arrayUp = array('Valor' => $Seq); $arrayCond = array('Nome=' => 'seq_laudo'); $resposta = $crud->update($arrayUp, $arrayCond); }
The variable $Seq = $Seq->Sequencia + 1;
has the correct value, but I can not do update
, the attempt I made was to put quotation marks in the variable $seq
because it will be stored in a varchar
field, but also not It worked.