Announcement

Collapse
No announcement yet.

Fatal error: MoveNext() on a non-object

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fatal error: MoveNext() on a non-object

    I have this message when producing code on a blank application since V7:

    Fatal error: Call to a member function MoveNext() on a non-object in C:\Program Files\NetMake\v7\wwwroot\scriptcase\devel\lib\php\ database.inc.php on line 889

    I have made some tests, it's a problem with the sql expressions in sc_lookup() like '%d/%m/%Y' or _utf8' ' (probably a problem with symbol ' ) with or all subqueries in general. Is it a bug ?

  • #2
    Originally posted by Stall_ONE View Post
    Is it a bug?
    Probably not ...

    Show the sql commands from your blank application, then we can say something more to. And check the commands with your database (phpmyadmin on mysql for example).
    Best regards: - Reinhard -

    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

    Comment


    • #3
      [QUOTE=RHS;16464]Probably not ...

      This code don't works in my blank application (it's works with mysql):

      sc_lookup(infos_periode, "SELECT DATE_FORMAT(Min(`TB_forfaits_tarification_modules` .`date_debut`),'%d/%m/%Y') AS `date_debut`, DATE_FORMAT(Max(`TB_forfaits_tarification_modules` .`date_fin`),'%d/%m/%Y') AS `date_fin`
      FROM (((`TB_inscriptions_classe` INNER JOIN `TB_inscriptions_eleve` ON `TB_inscriptions_classe`.`num_inscription_eleve` = `TB_inscriptions_eleve`.`num_inscription_eleve`) INNER JOIN `TB_inscription_eleve_modules` ON `TB_inscriptions_eleve`.`num_inscription_eleve` = `TB_inscription_eleve_modules`.`num_inscription_el eve`) INNER JOIN `TB_inscription_eleve_forfaits` ON `TB_inscriptions_eleve`.`num_inscription_eleve` = `TB_inscription_eleve_forfaits`.`num_inscription_e leve`) INNER JOIN `TB_forfaits_tarification_modules` ON (`TB_inscription_eleve_modules`.`num_module_format ion` = `TB_forfaits_tarification_modules`.`num_module_for mation`) AND (`TB_inscription_eleve_forfaits`.`num_forfait_tari fication` = `TB_forfaits_tarification_modules`.`num_forfait_ta rification`)
      WHERE (((`TB_inscriptions_classe`.`num_classe`)=$num_cla sse) AND ((`TB_inscriptions_eleve`.`num_eleve`)=$num_eleve) AND ((`TB_inscriptions_eleve`.`num_inscription_eleve`) =$num_inscription_eleve))
      ");



      But this one yes:

      $sql_format_date = "'%d/%m/%Y'";

      sc_lookup(infos_periode, "SELECT DATE_FORMAT(Min(`TB_forfaits_tarification_modules` .`date_debut`),$sql_format_date) AS `date_debut`, DATE_FORMAT(Max(`TB_forfaits_tarification_modules` .`date_fin`),'%d/%m/%Y') AS `date_fin`
      FROM (((`TB_inscriptions_classe` INNER JOIN `TB_inscriptions_eleve` ON `TB_inscriptions_classe`.`num_inscription_eleve` = `TB_inscriptions_eleve`.`num_inscription_eleve`) INNER JOIN `TB_inscription_eleve_modules` ON `TB_inscriptions_eleve`.`num_inscription_eleve` = `TB_inscription_eleve_modules`.`num_inscription_el eve`) INNER JOIN `TB_inscription_eleve_forfaits` ON `TB_inscriptions_eleve`.`num_inscription_eleve` = `TB_inscription_eleve_forfaits`.`num_inscription_e leve`) INNER JOIN `TB_forfaits_tarification_modules` ON (`TB_inscription_eleve_modules`.`num_module_format ion` = `TB_forfaits_tarification_modules`.`num_module_for mation`) AND (`TB_inscription_eleve_forfaits`.`num_forfait_tari fication` = `TB_forfaits_tarification_modules`.`num_forfait_ta rification`)
      WHERE (((`TB_inscriptions_classe`.`num_classe`)=$num_cla sse) AND ((`TB_inscriptions_eleve`.`num_eleve`)=$num_eleve) AND ((`TB_inscriptions_eleve`.`num_inscription_eleve`) =$num_inscription_eleve))
      ");

      so the problem is my first '%d/%m/%Y' used in format_date definition, the second one with the same syntax works fine, no change necessary, that is strange.

      Comment


      • #4
        Hello,

        Issue reported to our bugs team.

        regards,
        Bernhard Bernsmann

        Comment


        • #5
          Originally posted by Stall_ONE View Post
          [...] that is strange.
          Yes ..., but check with "Debug mode = Yes" the sql output from sc at runtime. Probably there is a difference ...
          Last edited by RHS; 08-11-2013, 02:16 AM. Reason: Quote repaired
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

          Comment


          • #6
            Debug On, no change...

            Comment


            • #7
              If you set the debug on you can see every sql statement before executing. You can see what sql statement has been generated causing the error. The errormessage implies that there's no cursor and useually that's due to a syntax error. Useually I set two checkboxes to look at the sql statement and script errors when I run into problems like this.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment


              • #8
                The Debug is on, but the message becomes during generation... the sql statement works fine directly in phpmyadmin. I have no problem in v6 with the same code.

                Comment


                • #9
                  Hello,

                  Could you export the application and send it to bugs@scriptcase.net?

                  regards,
                  Bernhard Bernsmann

                  Comment


                  • #10
                    I'm facing the problem, when I generate the code on scriptcase for all Grid & Forms. There is no error on those pages. All are worked fine upto yesterday.
                    Fatal error: Call to a member function MoveNext() on a non-object in C:\Program Files\NetMake\v8\wwwroot\scriptcase\devel\lib\php\ database.inc.php on line 1719

                    Comment

                    Working...
                    X