My query ($query3) giving error because I engaged 3 update statement in a query. It said "Characters found after end of SQL statement" or not constructed properly. I tested following 3 ways. but no wone working. If i use just 1 upade statement the it works fine. Please help me and tell me how can I make it work. $conn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)}; DBQ=E:\x.mdb','',''); $query3 = "UPDATE daily_index SET cscx_show = '$show_value', cscx_value = '$cscx_value' WHERE cscx_name = 'value';"; $query3 .= "UPDATE daily_index SET cscx_show = '$show_change', cscx_value = '$cscx_change' WHERE cscx_name = 'change';"; $query3 .= "UPDATE daily_index SET cscx_show = '$show_unchanged', cscx_value = '$cscx_percent_change' WHERE cscx_name = 'percent_change'"; //---------------------------------- $query3 = "UPDATE daily_index SET cscx_show = '$show_value', cscx_value = '$cscx_value' WHERE cscx_name = 'value'; UPDATE daily_index SET cscx_show = '$show_change', cscx_value = '$cscx_change' WHERE cscx_name = 'change'; UPDATE daily_index SET cscx_show = '$show_unchanged', cscx_value = '$cscx_percent_change' WHERE cscx_name = 'percent_change'"; //----------------------------------- $query3 = "UPDATE daily_index SET (cscx_show = '$show_value', cscx_value = '$cscx_value' WHERE cscx_name = 'value'), (cscx_show = '$show_change', cscx_value = '$cscx_change' WHERE cscx_name = 'change'), (cscx_show = '$show_unchanged', cscx_value = '$cscx_percent_change' WHERE cscx_name = 'percent_change')"; odbc_exec($conn, $query3) or die ("Error in update query 3. "); PHP:
Here's something more relevant. http://stackoverflow.com/questions/9162671/multiple-sql-update-statements-in-single-query