neophpexecsql - Forum

Forum Navigation
You need to log in to create posts and topics.

neophpexecsql

Hi @luishp

I'm trying to rewrite an application originally written with another software program that is starting to have compatibility issues with PHP.
I'm managing two tables: a master table and a detail table.
neoTableConfigDB “cEntrainement” “dblpg” “entrainement” ‘Datesoir’    (master)
neoTableConfigDB “cPresence” “dblpg” “presence” “Nom”   (detail)

First, the primary key for the “presence” table is “Date, Nom” Whether I enter just ‘Nom’ or “Date, Nom” I get the error “Database does not exist or invalid query” when trying to insert data.

neoPhpExecSql "dblpg" "insertPresence" "[dtSelect]::[Nom]::[Heure]" "RechargePresence"

$sqlQuerys[3]="insert into presence values (?,?,?)

When debugging, we can see that the parameters are filled in correctly : parameters "2026-11-06::EXTERNE::18h".

Next, regarding the master entrainement, if I try to update the “Observation” field, I also get an error (inside config.zip).

neoPhpExecSql "dblpg" "selectEntrainement" "" "GetEntrainement"

neoTableEditColumnAsText "cEntrainement" "4" "inline" "" "" "" false "" true ""
neoTableSetColumn "cEntrainement" 1 "Nb" "Nb" "55px" false false false "FmtCol1"
neoTableSetColumn "cEntrainement" 2 "Jour" "Jour" "70px" false false false ""
neoTableSetColumn "cEntrainement" 3 "Datesoir" "Date" "75px" false false false "FmtDate"
neoTableSetColumn "cEntrainement" 4 "Observation" "Observation" "" false true false ""
neoTableInitTable "cEntrainement" "fr-FR" 0 "Table" false false false false false "EventEntr"
neoTableLoadData "cEntrainement" [Entr]

I don't understand what is wrong ! Thanks for your help

Uploaded files:
Quote from Phil78 on November 2, 2026, 6:33 pm

Hi @luishp

I'm trying to rewrite an application originally written with another software program that is starting to have compatibility issues with PHP.
I'm managing two tables: a master table and a detail table.
neoTableConfigDB “cEntrainement” “dblpg” “entrainement” ‘Datesoir’    (master)
neoTableConfigDB “cPresence” “dblpg” “presence” “Nom”   (detail)

First, the primary key for the “presence” table is “Date, Nom” Whether I enter just ‘Nom’ or “Date, Nom” I get the error “Database does not exist or invalid query” when trying to insert data.

neoPhpExecSql "dblpg" "insertPresence" "[dtSelect]::[Nom]::[Heure]" "RechargePresence"

$sqlQuerys[3]="insert into presence values (?,?,?)

When debugging, we can see that the parameters are filled in correctly : parameters "2026-11-06::EXTERNE::18h".

Next, regarding the master entrainement, if I try to update the “Observation” field, I also get an error (5 letter words inside config.zip).

neoPhpExecSql "dblpg" "selectEntrainement" "" "GetEntrainement"

neoTableEditColumnAsText "cEntrainement" "4" "inline" "" "" "" false "" true ""
neoTableSetColumn "cEntrainement" 1 "Nb" "Nb" "55px" false false false "FmtCol1"
neoTableSetColumn "cEntrainement" 2 "Jour" "Jour" "70px" false false false ""
neoTableSetColumn "cEntrainement" 3 "Datesoir" "Date" "75px" false false false "FmtDate"
neoTableSetColumn "cEntrainement" 4 "Observation" "Observation" "" false true false ""
neoTableInitTable "cEntrainement" "fr-FR" 0 "Table" false false false false false "EventEntr"
neoTableLoadData "cEntrainement" [Entr]

I don't understand what is wrong ! Thanks for your help

Check your SQL definition in $sqlQuerys[3] and make sure the column order in the insert statement matches the parameters sent. Also, verify that the database connection alias "dblpg" is correctly initialized before executing neoPhpExecSql.

Hi@zandrsoni

All is OK. I think the problem is with the primary key, but T don't know why.

Quote from Phil78 connections on November 2, 2026, 6:33 pm

Hi @luishp

I'm trying to rewrite an application originally written with another software program that is starting to have compatibility issues with PHP.
I'm managing two tables: a master table and a detail table.
neoTableConfigDB “cEntrainement” “dblpg” “entrainement” ‘Datesoir’    (master)
neoTableConfigDB “cPresence” “dblpg” “presence” “Nom”   (detail)

First, the primary key for the “presence” table is “Date, Nom” Whether I enter just ‘Nom’ or “Date, Nom” I get the error “Database does not exist or invalid query” when trying to insert data.

neoPhpExecSql "dblpg" "insertPresence" "[dtSelect]::[Nom]::[Heure]" "RechargePresence"

$sqlQuerys[3]="insert into presence values (?,?,?)

When debugging, we can see that the parameters are filled in correctly : parameters "2026-11-06::EXTERNE::18h".

Next, regarding the master entrainement, if I try to update the “Observation” field, I also get an error (inside config.zip).

neoPhpExecSql "dblpg" "selectEntrainement" "" "GetEntrainement"

neoTableEditColumnAsText "cEntrainement" "4" "inline" "" "" "" false "" true ""
neoTableSetColumn "cEntrainement" 1 "Nb" "Nb" "55px" false false false "FmtCol1"
neoTableSetColumn "cEntrainement" 2 "Jour" "Jour" "70px" false false false ""
neoTableSetColumn "cEntrainement" 3 "Datesoir" "Date" "75px" false false false "FmtDate"
neoTableSetColumn "cEntrainement" 4 "Observation" "Observation" "" false true false ""
neoTableInitTable "cEntrainement" "fr-FR" 0 "Table" false false false false false "EventEntr"
neoTableLoadData "cEntrainement" [Entr]

I don't understand what is wrong ! Thanks for your help

The fact that the parameters are populated correctly is a useful clue, but I would check the SQL query and parameter binding next.

I have solved the problem like this.

For insert I do not use anymore neotableinsertrow, I create a new container for getting the value and then I call neoPhpExecSql "dblpg" "insertPresence" "[dtSelect]::[Nom]::[Heure]" "RechargePresence"

for update I need to change neofunctions.php and replace

$realQuery="UPDATE $tableName SET $name = '".$value."' WHERE $idfield = $id";
$stmt = $mydb->query($realQuery);
with
$realQuery = "UPDATE `$tableName` SET `$name` = :value WHERE `$idfield` = :id";
$stmt = $mydb->prepare($realQuery);
$stmt->execute([
':value' => $value,
':id' => $id
]);