|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-04-03 11:25 UTC] rasmus@php.net
[2001-04-03 13:12 UTC] jules at acris dot co dot uk
[2001-04-03 13:23 UTC] jules at acris dot co dot uk
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
Example script: mysql> use test; mysql> create table mytable (a int primary key auto_increment, b int, c int); <?php mysql_connect("localhost","root","bannerjee"); mysql_select_db("test"); mysql_query("insert into mytable values (null, 5, 6)"); echo mysql_insert_id(); $res = mysql_query("select last_insert_id()"); $row = mysql_fetch_row($res); echo "<BR>$row[0]"; ?> Example output: 722 8 Mysql 2.23.33; using the library provided with mysql (ie configure --with-mysql=/usr).