note 18712 added to function.mssql-fetch-row

From: Date: Fri, 01 Feb 2002 15:44:53 +0000
Subject: note 18712 added to function.mssql-fetch-row
Groups: php.notes 
Request: Send a blank email to php-notes+get-26126@lists.php.net to get a copy of this message
It took me way too long to notice the MySQL error in the note above (way tooo late and not enough sleep). Here's what I hacked up: <?php $hostname = "localhost"; $username = "username"; $password = "password"; $dbName = "database"; MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED TO RESPOND."); mssql_select_db($dbName) or DIE("Table unavailable"); $query = "SELECT * FROM dbo.table"; $result = mssql_query( $query ); for ($i = 0; $i < mssql_num_rows( $result ); ++$i) { $line = mssql_fetch_row($result); print( "$line[0] - $line[1]\n"); } ?> Thanks, will_ @ irc.openprojects.net#php -- http://www.php.net/manual/en/function.mssql-fetch-row.php http://master.php.net/manage/user-notes.php?action=edit+18712 http://master.php.net/manage/user-notes.php?action=delete+18712 http://master.php.net/manage/user-notes.php?action=reject+18712

« previous php.notes (#26126) next »