In my query I need to insert the auto-increment ID of my row into another column.
I need the protonumber column to have 3 strings together, but I can't figure out how to retrieve the current lastinsertID and make it work.
Any ideas?
$stmt = $db->prepare('INSERT INTO protonumbers (season,program,designer,brand,date,protonumber) VALUES (:season, :program, :designer, :brand, :date, :protonumber)');
$last_id = $pdo->lastInsertId();
$stmt->execute(array(
':season' => $season,
':program' => $program,
':designer' => $designer,
':brand' => $brand,
':date' => $date,
':protonumber' => "{$program}-{$season}-{$last_id}"
));
$id = $db->lastInsertId('protoID');