Tried quite a few ways but always returns: Any ideas? EDIT Using MSSQL and mainly getting not supported by driver error. Is there any way I can incorporate getting the last ID without running a SELECT query? if(isset($_POST['createpub'])) { //Create publication $sth = $dbconn->prepare("INSERT INTO publication (title, text, cat, user_id, use_ad, viewcount, tags) VALUES (:title, :text, :cat, :user_id, :use_ad, :viewcount, :tags)"); $params = array( "title" => $_POST[title], "text" => $_POST[description], "cat" => $_POST[category], "user_id" => $userid, "use_ad" => 0, "viewcount" => 0, "tags" => $_POST[keywords] ); $status = $sth->execute($params); if ($status) { //Create folder using insert id echo $sth->lastInsertId(); //mkdir("../publication/$userid/$sth->lastInsertId()"); } else { //Failed //Debug test print_r($params); } PHP:
Tried many different variations. Always end up with unsupported driver error though. Although the driver I have is MSSQL_70 This should work shouldn't it?