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 ?

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).

[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_eleve) INNER JOIN TB_inscription_eleve_forfaits ON TB_inscriptions_eleve.num_inscription_eleve = TB_inscription_eleve_forfaits.num_inscription_eleve) INNER JOIN TB_forfaits_tarification_modules ON (TB_inscription_eleve_modules.num_module_formation = TB_forfaits_tarification_modules.num_module_formation) AND (TB_inscription_eleve_forfaits.num_forfait_tarification = TB_forfaits_tarification_modules.num_forfait_tarification)
WHERE (((TB_inscriptions_classe.num_classe)=$num_classe) 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_eleve) INNER JOIN TB_inscription_eleve_forfaits ON TB_inscriptions_eleve.num_inscription_eleve = TB_inscription_eleve_forfaits.num_inscription_eleve) INNER JOIN TB_forfaits_tarification_modules ON (TB_inscription_eleve_modules.num_module_formation = TB_forfaits_tarification_modules.num_module_formation) AND (TB_inscription_eleve_forfaits.num_forfait_tarification = TB_forfaits_tarification_modules.num_forfait_tarification)
WHERE (((TB_inscriptions_classe.num_classe)=$num_classe) 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.

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

Yes …, but check with “Debug mode = Yes” the sql output from sc at runtime. Probably there is a difference …

Debug On, no change…

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.

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.

Hello,

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

regards,
Bernhard Bernsmann

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