Hi Jong, The problem is your Query is in looping situation. Because you didn't close the link after your first inserted. It doesn't matter that you use (mssql_free), you still need to close the link first. The function of mssql_free is just free up the content of that variable, but it won't close the link for U. Kelvin. "jong jong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I got the error messages with your help. Unfortunatly, > I didn't see any problem in these message. Here is the > messages on my browser by loading the php file: > Changed database context to 'pubs'. > Changed database context to 'pubs'.query2 failed! > Changed database context to 'pubs'.query3 failed! > > It didn't tell me anything about why query failed. My > code is like this: > <? > $conn=mssql_connect("xxx","xxx","xxxxxxxx"); > mssql_select_db("pubs",$conn); > > $result=mssql_query("select * from authors"); > echo mssql_get_last_message(); > if (!$result) > echo "query1 failed!"; > mssql_free_result($result); > > $result=mssql_query("insert into pub_info values > (0001,null,'test1')"); > > echo "<p>".mssql_get_last_message(); > if (!$result) > echo "query2 failed!"; > else > mssql_free_result($result); > > $result=mssql_query("insert into pub_info values > (0002,null,'test2')"); > echo "<p>".mssql_get_last_message(); > if (!$result) > echo "query3 failed!"; > else > mssql_free_result($result); > ?> > > When I look into the table on MSSQL Server, Record > "0001,null,test1" was inserted. > But no record "0002,null,test2". This makes me feel > that query2 and query3 failed on different reasons! > Any one see why query2 failed and query3 failed? > > Thanks, > jongjong > > __________________________________________________ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail > http://personal.mail.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]