cvs: phpdoc /en/reference/mysql/functions mysql-insert-id.xml

From: Date: Sun, 21 Apr 2002 17:18:18 +0000
Subject: cvs: phpdoc /en/reference/mysql/functions mysql-insert-id.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969344684@lists.php.net to get a copy of this message
georg Sun Apr 21 13:18:18 2002 EDT Modified files: /phpdoc/en/reference/mysql/functions mysql-insert-id.xml Log: added samples added seealso Index: phpdoc/en/reference/mysql/functions/mysql-insert-id.xml diff -u phpdoc/en/reference/mysql/functions/mysql-insert-id.xml:1.2 phpdoc/en/reference/mysql/functions/mysql-insert-id.xml:1.3 --- phpdoc/en/reference/mysql/functions/mysql-insert-id.xml:1.2 Wed Apr 17 02:41:12 2002 +++ phpdoc/en/reference/mysql/functions/mysql-insert-id.xml Sun Apr 21 13:18:18 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/mysql.xml, last change in rev 1.2 --> <refentry id="function.mysql-insert-id"> <refnamediv> @@ -50,6 +50,24 @@ <literal>LAST_INSERT_ID()</literal> in an SQL query. </para> </warning> + <example> + <title>mysql_insert_id Example</title> + <programlisting role="php"> +<![CDATA[ +<?php + mysql_connect("localhost", "mysql_user", "mysql_password") or + die("could not connect"); + mysql_select_db("mydb"); + + mysql_query("INSERT INTO mytable (product) values ('kossu'); + printf ("Last inserted record has id %d\n", mysql_insert_id()); +?> +]]> + </programlisting> + </example> + <para> + See also: <function>mysql_query</function>. + </para> </refsect1> </refentry>

« previous php.doc (#969344684) next »