SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Jan 14, 2001, 09:00 #1
- Join Date
- Nov 2000
- Location
- Oslo, Norway
- Posts
- 413
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
One of the scripts I'm writing saves an article into a database based on the information inputted by the user. The ID of the article is set up AUTO_INCREMENT.
However, the next task of the script is to add chapters to this specific article, and for that, I need the article ID. Is there any way of fetching this? I mean, since it's set by AUTO_INCREMENT, I have no idea what it is, right?
Thanks in advance !
-
Jan 14, 2001, 12:57 #2
- Join Date
- Aug 2000
- Location
- San Diego, CA
- Posts
- 5,460
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
So this is after you put it in the db you can use
$db = mysql_connect("", "", "");
msyql_select_db("");
$result = mysql_query("INSERT...");
$nextid = mysql_insert_id($db);
Please don't PM me with questions.
Use the forums, that is what they are here for.
Bookmarks