msql_query: incorporate example from user note

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64142 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
jim winstead 2001-12-07 02:29:01 +00:00
parent ba0795a360
commit 0454bf328c

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.19 $ -->
<!-- $Revision: 1.20 $ -->
<reference id="ref.msql">
<title>mSQL functions</title>
<titleabbrev>mSQL</titleabbrev>
@ -986,6 +986,28 @@
Returns a positive mSQL query identifier on success, or &false; on
error.
</para>
<example>
<title><function>msql_query</function></title>
<programlisting role="php">
<![CDATA[
<?php
$link = msql_connect("dbserver")
or die("unable to connect to msql server: ".msql_error());
msql_select_db("db", $link)
or die("unable to select database 'db': ".msql_error());
$result = msql_query("SELECT * FROM table WHERE id=1", $link);
if (!$result) {
die("query failed: ".msql_error());
}
while ($row = msql_fetch_array($result)) {
echo $row["id"];
}
?>
]]>
</programlisting>
</example>
<para>
See also: <function>msql</function>,
<function>msql_select_db</function>, and