note 10024 rejected and deleted from mssql_connect by ronabop
| From: | ronabop@php.net | Date: | Sun, 10 Dec 2000 03:43:33 +0000 |
| Subject: | note 10024 rejected and deleted from mssql_connect by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8562@lists.php.net to get a copy of this message | ||
I have problems running the code in first note! ERROR :
Warning: Supplied argument is not a valid MS SQL-result resource in - on line 14
No data?
But I input data in database teste!!!!
<?
$hostname = "orion";
$username = "sa";
$password = "";
$dbName = "teste";
MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");
$query = "SELECT * FROM a";
$result = MSSQL_QUERY($query);
$number = MSSQL_NUM_ROWS($result);
$i=0;
if ($number == 0) :
print "No data?";
elseif ($number > 0) :
print "Data:
";
while ($i < $number) :
$name = mssql_result($result,$i,"Name");
print $name;
print "
";
$i++;
endwhile;
endif;
?>