This topic is locked

Error in UPDATE

7/10/2011 3:05:33 AM
PHPRunner General questions
M
maxcolo author

Hi,

My event in after record added is

global $conn;

$strSQLUpdate = "UPDATE prestazioni_avute set IDsocio='".$values["IDsocio"]."',Prestazione='".$values["Prestazione"]."',OreDate='".$values["OreDate"]."',Data='".$values["Data"]."',Assegno='".$values["Assegno"]."',Beneficiario='".$values["Beneficiario"]."',

where IDprestazione=".$values["IDprestazione"];

db_exec($strSQLUpdate,$conn);

but I have error Duplicare Key record 12, what is the my sintax problem?

Best regards

C
cgphp 7/10/2011

Don't use single quote for integer values (for example for IDsocio. I don't know if other values are integers.) After Beneficiario remove the comma.

global $conn;

$strSQLUpdate = "UPDATE prestazioni_avute set

IDsocio=".$values["IDsocio"].",

Prestazione='".$values["Prestazione"]."',

OreDate='".$values["OreDate"]."',

Data='".$values["Data"]."',

Assegno='".$values["Assegno"]."',

Beneficiario='".$values["Beneficiario"]."'

WHERE IDprestazione=".$values["IDprestazione"];

db_exec($strSQLUpdate,$conn);
M
maxcolo author 7/10/2011

Thanks for the help,

correct syntax error but still ........... Duplicate Key

other ideas ......

Regards to all

C
cgphp 7/10/2011

It's hard to say what's happening. We need more info about your database schema.

Sergey Kornilov admin 7/11/2011

maxcolo,
I would suggest to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.