Re: mssql, query and schoolboy error

From: Date: Fri, 19 Apr 2002 18:20:34 +0000
Subject: Re: mssql, query and schoolboy error
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-13200@lists.php.net to get a copy of this message
Here is your problem: below is your code: <snip> $result = mssql_query($query,$link); file://JUST CRASHES ON THIS LINE $r = mssql_rows_affected ( $link); </snip> The 2nd line there: $r = mssql_rows_affected( $link ); should be $r = mssql_rows_affected( $result ); AND, you do not need to pass the $link into the mssql_query($query) function at that point. It's understood. Hope that helped ! :) If you get an error occurred on such and such line, it isn't always necessary the correct line. It may be the line before, or even multiple lines before. Good luck, -- Nicole Amashta Web Application Developer www.aeontrek.com "Rob Fraser" <rob.fraser@elmwood.co.uk> wrote in message news:CEF704DF687172498983EA48C2DC1D9F17FF0C@exchange.w2kdomain.elmwood.co.uk ... Dear All, I hope somebody can help me. I am new to PHP (I've used ASP for three years:-( ) and I'm loving PHP and trying to get my work to convert but I've coming across a error with mssql_query() explorer its just crashes with a php.exe 'memory could not be read error'. I'm sure it a school boy error from me but I'm just stuck, please help me code is...... =========== $link = mssql_connect ("laptop", "sa", "elmwood"); print ("<br>LINK was $link"); $back = mssql_select_db ( "elmback",$link); print("<br>back was $back"); $query = "SELECT * FROM tblperson"; print("<br>query was $query"); $result = mssql_query($query,$link); file://JUST CRASHES ON THIS LINE $r = mssql_rows_affected ( $link); print("<br>rows affected was $r"); $close = mssql_close ($link); print("<br>close was $close"); ========= I run IIS4, NT4 (SP6a) and SQL 7 on the same machine as its my development one, out of date maybe but you should see my clothes but PHP was test downloaded a month ago - any ideas from a white knight? best regards Rob

« previous php.windows (#13200) next »