mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
pkgsubmit.php: Pull out DB code
* Move DB code in pkgsubmit.php to new functions in aur.inc.php and pkgfuncs.inc.php * Centralization of DB code important in a future transition to PDO interface Signed-off-by: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
82d234c4d5
commit
763cbf8373
3 changed files with 129 additions and 48 deletions
|
@ -512,3 +512,24 @@ function parse_comment($comment) {
|
|||
|
||||
return $html;
|
||||
}
|
||||
|
||||
function begin_atomic_commit($dbh=NULL) {
|
||||
if(!$dbh) {
|
||||
$dbh = db_connect();
|
||||
}
|
||||
db_query("BEGIN", $dbh);
|
||||
}
|
||||
|
||||
function end_atomic_commit($dbh=NULL) {
|
||||
if(!$dbh) {
|
||||
$dbh = db_connect();
|
||||
}
|
||||
db_query("COMMIT", $dbh);
|
||||
}
|
||||
|
||||
function last_insert_id($dbh=NULL) {
|
||||
if(!$dbh) {
|
||||
$dbh = db_connect();
|
||||
}
|
||||
return mysql_insert_id($dbh);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue