B
|
btman author 1/30/2011 |
Hi, I have a table in which minutes and seconds are added to total time using the concat SQL statement. It works with the SQL tool. But this only updates the required fields in the frontend. It doesn't update the database. I've tried the query in PHPmyadmin and it does the job: UPDATE evaluation SET dist_total=concat(dist_minutes,'.',dist_seconds); UPDATE evaluation SET plank_total=concat(plank_minutes,'.',plank_seconds); UPDATE evaluation SET squat_total=concat(squat_minutes,'.',squat_seconds) I have added following in the After Record Added event: global $conn; $strSQLUpdate = "UPDATE evaluation SET dist_total=concat(dist_minutes,'.',dist_seconds); UPDATE evaluation SET plank_total=concat(plank_minutes,'.',plank_seconds); UPDATE evaluation SET squat_total=concat(squat_minutes,'.',squat_seconds)"; db_exec($strSQLUpdate,$conn); But when adding a record an SQL error is displayed: I have tried to add double quotes at the beginning and end of each update, but that only updates the last update statement. Hopefully you will be able to point me into the right direction. It is probably something simple, but I have only limited SQL/PHP knowledge. Thanks for your help. Ben
|