From c8a97026203995f2c9123a01142074a8ffc2eeba Mon Sep 17 00:00:00 2001 From: jchu Date: Wed, 15 Dec 2004 02:46:04 +0000 Subject: everything except package contents done --- web/lib/pkgfuncs.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 54848ce6..b4f04d1b 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -127,7 +127,7 @@ function create_dummy($pname="", $sid="") { $q = "SELECT ID FROM Packages WHERE Name = '"; $q.= mysql_escape_string($pname)."'"; $result = db_query($q, $dbh); - if (!$result) { + if (!mysql_num_rows($result)) { # Insert the dummy # $q = "INSERT INTO Packages (Name, Description, URL, SubmittedTS, "; @@ -138,10 +138,10 @@ function create_dummy($pname="", $sid="") { if (!$result) { return NULL; } - return mysql_insert_id($result); + return mysql_insert_id($dbh); } else { $data = mysql_fetch_row($result); - return $data['ID']; + return $data[0]; } } return NULL; -- cgit v1.2.3-24-g4f1b