RE: [PHP-WIN] Sending a Serious Query to MSSQL
| From: | Paco Ortiz | Date: | Fri, 05 Jan 2001 09:25:32 +0000 |
| Subject: | RE: [PHP-WIN] Sending a Serious Query to MSSQL | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4826@lists.php.net to get a copy of this message | ||
Hi:
> As you can see, I send multiple commands to SQL server, rather than one.
> Now, $result doesn't return a valid identifier if I use the method above.
> If I break the query into individual pieces and send them to SQL server via
> PHP individually, it works fine. However, what are the resource implications
> of this? Does it actually connect to the server 4 times? Anyone really give
> a crap? :)
you don't have to connect 4 times, you have to connect once, and call mssql_query 4 times.
It's not that bad after all, I promise.
If you want to execute several sentences in one, returning ONLY ONE recorset (for example, several
insert, update, transactions, conditional flow and ONE select), create a stored procedure, and call
it with:
$result=mssql_query("execute myprocedure($parameters)");
Paco
> Thanks in advance.
>
> -Flint
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>