cvs: phpdoc /en/functions msql.xml

From: Date: Fri, 07 Dec 2001 02:29:01 +0000
Subject: cvs: phpdoc /en/functions msql.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969339513@lists.php.net to get a copy of this message
jimw Thu Dec 6 21:29:01 2001 EDT Modified files: /phpdoc/en/functions msql.xml Log: msql_query: incorporate example from user note Index: phpdoc/en/functions/msql.xml diff -u phpdoc/en/functions/msql.xml:1.19 phpdoc/en/functions/msql.xml:1.20 --- phpdoc/en/functions/msql.xml:1.19 Tue Nov 20 18:58:45 2001 +++ phpdoc/en/functions/msql.xml Thu Dec 6 21:29:01 2001 @@ -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

« previous php.doc (#969339513) next »