its pretty easy, so you have your query:
PHP Code:
// we need to start the session if we are accessing $_SESSION
session_start();
$query = mysql_query("INSERT INTO clients (a, b) VALUES ('$a', '$b')");
$newID = mysql_insert_id();
// at this stage I would store the client id into the session to remember it for the pet form
$_SESSION['client_id'] = $newID;
Now for the pet form
PHP Code:
// we need to start the session if we are accessing $_SESSION
session_start();
$client_id = (int)$_SESSION['client_id'];
$query = mysql_query("INSERT INTO pets (client_id, b) VALUES ($client_id, '$b')");
This is probably the easiest it can be, perhaps the next level would be to allow user logins to retrieve and edit their pets in the future.
Bookmarks