Re: What does these error message mean?

From: Date: Thu, 05 Jul 2001 22:04:58 +0000
Subject: Re: What does these error message mean?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10098@lists.php.net to get a copy of this message
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" <jxu158@yahoo.com> wrote in message news:20010705203752.36885.qmail@web11502.mail.yahoo.com... > 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/

« previous php.db (#10098) next »