Using IBM DB2 V7.1 and MS SQL Server 7 ODBC database connections.Print the result of odbc_error() or odbc_errormsg() after each call to an odbc_ function that gives no error and, sooner or later, you'll get garbage instead of a blank string!

I have use this function, its very simple and cute.with IBM DB2<?php// you must set the connection firstif (odbc_error()) { echo odbc_errormsg($conn); }// if you want to show the perfect error message // then format it using string functions.?>Have a good day!