Re: Re: What does these error message mean?

From: Date: Thu, 05 Jul 2001 22:52:46 +0000
Subject: Re: Re: What does these error message mean?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10101@lists.php.net to get a copy of this message
Your suggestion sounds interesting. But how to close the link? Do you mean mssql_close()? What I know is that we can do multiple querys during one database connection. I guess I didn't explain my problem clear enough. Sorry about that. My point is why query works always well until the first update query("insert","update","delete"). It doesn't matter how many select query before that. It could be 10 "select" or none. But once update query appears, I get "query failed". The interesting thing is, this query is acturally executed in my database but return false. Then all the other querys follow this one are failed and no affect to my database. This table might help: return affect db ----------------------------------------------- connect... true repeat 0 or n: query("select...") true done query("insert...") or query("update...") or query("delete...") false Yes repeat 1 or n: query("select...") or query("update...") or query("delete...") or query("insert...") false No done close... true Did anyone try this on your machine? What did you get? jongjong --- Kelvin <kelvinyip@hotmail.com> wrote: > 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/ > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-db-unsubscribe@lists.php.net > For additional commands, e-mail: > php-db-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/

« previous php.db (#10101) next »