Re: MSSQL System Store Procedures
| From: | Frank M. Kromann | Date: | Tue, 06 May 2003 17:55:50 +0000 |
| Subject: | Re: MSSQL System Store Procedures | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27559@lists.php.net to get a copy of this message | ||
Hi Adam,
I have just tested both procedures and I do not get any errors. This is my
code
<?php
if (!extension_loaded("mssql")) dl("php_mssql.dll");
$con = mssql_connect("<host>", "<user>", ",password>");
if (is_resource($con)) {
$rs = mssql_query("sp_helplogins", $con);
if (is_resource($rs)) {
do {
echo "Fetchiong Results\n";
while ($row_data = mssql_fetch_assoc($rs)) {
print_r($row_data);
}
} while (mssql_next_result($rs));
mssql_free_result($rs);
}
mssql_close($con);
$rs = mssql_query("sp_helpsrvrolemember dbcreator", $con);
if (is_resource($rs)) {
do {
echo "Fetchiong Results\n";
while ($row_data = mssql_fetch_assoc($rs)) {
print_r($row_data);
}
} while (mssql_next_result($rs));
mssql_free_result($rs);
}
mssql_close($con);
}
?>
- Frank
> Ok, using Query Analyzer "sp_helpsrvrolemember dbcreator" work's
> fine, it returns a list of users allowed to create databases.
>
> The problem is that under PHP, when I execute that, it return's
> an error, even though I'm logged in as the exact same user
> I was with Query Analyzer.
>
> Other system stored procedures work like "sp_helplogins" so
> what's the deal? Any ideas?
>
> --
> Adam Voigt (adam@cryptocomm.com)
> Linux/Unix Network Administrator
> The Cryptocomm Group
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>