mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-25 13:28:56 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329325 c90b9560-bf6c-de11-be94-00142212c4b1
102 lines
2.5 KiB
XML
102 lines
2.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="function.sqlsrv-has-rows" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>sqlsrv_has_rows</refname>
|
|
<refpurpose>Indicates whether the specified statement has rows</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>sqlsrv_has_rows</methodname>
|
|
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Indicates whether the specified statement has rows.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>stmt</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
A statement resource returned by <function>sqlsrv_query</function> or
|
|
<function>sqlsrv_execute</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns &true; if the specified statement has rows and &false; if the statement
|
|
does not have rows or if an error occurred.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>sqlsrv_has_rows</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$server = "serverName\sqlexpress";
|
|
$connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" )
|
|
$conn = sqlsrv_connect( $server, $connectionInfo );
|
|
|
|
$stmt = sqlsrv_query( $conn, "SELECT * FROM Table_1");
|
|
|
|
if ($stmt) {
|
|
$rows = sqlsrv_has_rows( $stmt );
|
|
if ($rows === true)
|
|
echo "There are rows. <br />";
|
|
else
|
|
echo "There are no rows. <br />";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>sqlsrv_num_rows</function></member>
|
|
<member><function>sqlsrv_query</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|