Picon

Handled errors.

Hello everybody, well:
I am working in an action in a manager inserting data in a table, in a foreach i am checking that every query is right(i mean foreign keys are correct for instance), so when a query is right it should be insert but when something is wrong in the query it shouldn't insert it, i just need add (concatenate)it to a variable and at the end of the foreach show what queries were wrong.
1.- It doesn't insert the wrong queries, queries right are inserted(this is fine).
2.- if there is a query right after a wrong query it doesn't insert it(wrong), only insert queries righst that are before one wrong query is find.

how can i get the errors and continue with the foreach without complications(insert queries right after queries wrong) and at the end just show as a message the queries that weren't inserted.

i am trying to do this:

foreach( $grupos as $grupoi ) {
        
          $insert="INSERT INTO PROGRAMACION_ESQ.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID) VALUES ($idn, '$grupon', $peranioId, $materiaId, $planId, $alumnos, $empleadoId)";
          $dbh->Execute($insert);

        $success = false;
        if ($dbh->Affected_Rows() > 0)
            $success = true;

            if ($success !== false) {
                 SGL::raiseMsg('Se insertaron los datos correctamente ', false, SGL_MESSAGE_INFO);
            } else {
                $insert.="\n";
            //SGL::raiseError($insert, SGL_ERROR_NOAFFECTEDROWS);
        }
      
}
            $output->xml=$insert;

You don't care about how can i get the values from the insert, the problem is with the messages in the errors.
I don't want this large error, i want to show something like.

Fatal error: Uncaught exception 'ADODB_Exception' with message 'oci8 error: [2291: ORA-02291: integrity constraint (PROGRAMACION_ESQ.EDUC_GRUPOS_FK1) violated - parent key not found] in EXECUTE("INSERT INTO PROGRAMACION_ESQ.EDUC_GRUPOS (ID, GRUPO, PERIODO_ANIO_ID, MATERIAS_ID, INST_DEPTOS_CARRERAS_PLANES_ID, CANT_ALUMNOS, EMPLEADOS_ID) VALUES (10, 'B', 8, 1, 1, 22, 596)") ' in /var/www/sii_dgest/lib/pear/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/sii_dgest/lib/pear/adodb/adodb.inc.php(1040): adodb_throw('oci8', 'EXECUTE', 2291, 'ORA-02291: inte...', 'INSERT INTO PRO...', false, Object(ADODB_oci8)) #1 /var/www/sii_dgest/lib/pear/adodb/drivers/adodb-oci8.inc.php(843): ADOConnection->_Execute('INSERT INTO PRO...', false) #2 /var/www/sii_dgest/modules/estructuraeducativa/classes/Educ_GruposServiciosWebMgr.php(300): ADODB_oci8->Execute('INSERT INTO PRO...') #3 /var/www/sii_dgest/lib/SGL/Manager.php(251): Educ_GruposServiciosWebMgr->_cmd_cliente(Object(SGL_Registry), Object(SGL_Output)) #4 /var/www/sii_dgest/lib in /var/www/sii_dgest/lib/pear/adodb/adodb-exceptions.inc.php on line 78

--
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.
markux | 27 Nov 15:26
Picon

Re: Seagull Status

Last year I switched from seagull to yii framework and I'm
enthusiastic about it: flexible, modular, generators and good
community.  perfect for all type of project.

On Oct 22, 8:30 am, "Heinrich Stoellinger" <hc.stoellin...@aon.at>
wrote:
> Thanks, Demian,
> If I wasn't fully engaged in my "hobby" as "president" (i.e. worker and troubleshooter!)
> for my 50 piece brassband I would certainly want to get involved deeper into the advancement
> of Seagull. Just had a conversation by e-mail with somebody from Iran who also uses it.
> Unfortunately IT is now (after nearly 30 years as a systems engineer with "Mother Blue"!)
> just a sideline. Still, I am on the internet with a very simple and static usage of
> Seagull. Essentially it's pages defined within the publishing module and targets
> publicity aspects. The goal has always been a package which integrates this aspect with
> a load of administrative tasks that have to be carried out for a brass band of some
> 50 people (repertoire, people, business connections, uniforms, concerts, instruments...).
> Seagull seems to be just right for this. On the other hand, it is of course somewhat
> risky to build up an application package on a framework where its future might be shakey.
> - especially in today's fast moving world.
> I have just started looking at Symphony2, but from the introductory pages I read I have
> a feeling that a lot of basic stuff (such as user administration, etc.) has to be
> programmed - and not just defined as under Seagull. Do you agree?
> Regards - and keep up the good work!
> Heinrich
>
>
>
>
>
>
>
>
>
> On Fri, 21 Oct 2011 19:52:44 +0200, Demian Turner <demiantur...@gmail.com> wrote:
> > Hi Henrich
>
> > You asked this same question to the list on 30 October 2010.  I unfortunately have very little free time
left over after running Seagull Systems, and all the code I do now is objective C/Cocoa.  It's a shame that
PHP dev work became so undervalued but sometimes you had to adapt ;-)
>
> > If someone wants to step forward and volunteer to be a more active maintainer, we can review any such
offers.  I do get quite a few proposals for help with docs/patches/etc but 95% of them fizzle out after a
week or so.
>
> > Other than that I have a CMS project coming up in a few weeks which will *force* me to work on the CMS module
and rest of the framework, for the those more patient members of the list this may bring some nice results.
>
> > cheers
>
> > Demian
>
> > On 15 Oct 2011, at 11:15, Oct15, Heinrich Stoellinger wrote:
>
> >> Hello,
> >> I wonder what the status of Seagull is at this time. Are there plans to develop
> >> it further or should one try to look at other offerings?
> >> Regards and best wishes
> >> Heinrich
>
> >> --
> >> Erstellt mit Operas revolution rem E-Mail-Modul:http://www.opera.com/mail/
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Seagull PHP Framework
General Group" group.
> >> To post to this group, send email to seagull_general <at> googlegroups.com.
> >> To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/seagull_general?hl=en.
>
> --
> Erstellt mit Operas revolution rem E-Mail-Modul:http://www.opera.com/mail/

--

-- 
You received this message because you are subscribed to the Google Groups "Seagull PHP Framework General
Group" group.
To post to this group, send email to seagull_general <at> googlegroups.com.
To unsubscribe from this group, send email to seagull_general+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/seagull_general?hl=en.


Gmane