RE: [PHP-DB] Puzzled by MSSQL

From: Date: Mon, 16 Oct 2000 17:19:27 +0000
Subject: RE: [PHP-DB] Puzzled by MSSQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3647@lists.php.net to get a copy of this message
What does your query look like, and which line is line 27 ? -- Troy Settle Pulaski Networks 540.994.4254 It's always a long day, 86400 doesn't fit into a short > -----Original Message----- > From: Alexandre Siufy [mailto:alex@tiaxa.net] > Sent: Monday, October 16, 2000 2:55 PM > To: php-db@lists.php.net > Subject: [PHP-DB] Puzzled by MSSQL > > > Hi folks, > > I'm having this weird problem connecting to a MS SQL Server > 7.0 database, > from 4.02 on Linux... > Here's a snippet of code: > > $resultado = mssql_query($sql); > $numero_pages = mssql_num_rows($resultado); > > $this_row=array(); > > if ($numero_pages > 0) { > for ($i; $i <= $numero_pages; $i++) { > $this_row = mssql_fetch_array($resultado); > $pagina_id = $this_row["PageID"]; > $pagina[$pagina_id] = $this_row["Name"]; > print $i . " " . $pagina_id . " " . $pagina[$pagina_id]; > } > } > else { > print "No results!"; > } > > The table I'm pulling this stuff from has only 2 rows (I > verified the > SELECT statement on Microsoft's SQL Console thing), but I'm only able to > pull the 1st row. When the script tries to fetch the 2nd row, I get this > error: > > Warning: 2 is not a valid Sybase result resource in db1.php on line 27 > > I'm sure I'm doing something wrong, but I simply can't see it... > Appreciate your help... > > -- > alexandre siufy > lead developer > tiaxa.com / www.tiaxa.com > (305) 665 1055 > > > > -- > 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 > >

« previous php.db (#3647) next »