art-web r523 - branches/art-hub/models
- From: thos svn gnome org
- To: svn-commits-list gnome org
- Subject: art-web r523 - branches/art-hub/models
- Date: Sun, 15 Jun 2008 22:04:17 +0000 (UTC)
Author: thos
Date: Sun Jun 15 22:04:17 2008
New Revision: 523
URL: http://svn.gnome.org/viewvc/art-web?rev=523&view=rev
Log:
* Implement get_total function
Modified:
branches/art-hub/models/backgrounds.php
Modified: branches/art-hub/models/backgrounds.php
==============================================================================
--- branches/art-hub/models/backgrounds.php (original)
+++ branches/art-hub/models/backgrounds.php Sun Jun 15 22:04:17 2008
@@ -21,6 +21,20 @@
return $table;
}
+
+ function get_total ($category)
+ {
+ $sql = "SELECT COUNT(name) FROM background
+ WHERE category = '$category'";
+ $r = mysql_query ($sql);
+ if (!$r)
+ printf ("Database error: %s", mysql_error());
+
+
+ $total = mysql_fetch_row ($r);
+
+ return $total[0];
+ }
}
?>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]