Subdomain Posts
None | 1 day ago
None | 1 day ago
None | 762 days ago
None | 762 days ago
None | 787 days ago
Recent Posts
None | 14 sec ago
Bash | 17 sec ago
None | 36 sec ago
None | 38 sec ago
VisualBasic | 46 sec ago
None | 59 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Oberon 2 | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By matt on the 24th of Jan 2008 12:52:54 PM Download | Raw | Embed | Report
  1. CLASS
  2.  
  3. ARRAY
  4. has all the fiels in the mySQL table, so we can filter the REQUEST information
  5.  
  6.  
  7.  
  8.         get($what)
  9.     {
  10.         switch templete
  11.        
  12.                 1 - select * from there where this
  13.             2 - select * from there where this and this
  14.            
  15.          query the database
  16.          return the $result from the query
  17.     }
  18.    
  19.     show($what, $template, $name)
  20.     {
  21.         switch template
  22.        
  23.         1--------
  24.         sub headers($name) etc and any DIVS required
  25.         $result = CALL get($what)
  26.         $markup = display($result, $template)
  27.         $markup .= any other markup required, e.g. more div, subheaderEnd etc.
  28.         ---------------------
  29.        
  30.         2--------
  31.         etc etc
  32.         ----------------------
  33.        
  34.         end switch
  35.        
  36.         return $markup
  37.      }
  38.      
  39.      display($template, $result)
  40.      {
  41.          global $db;
  42.          
  43.          SWITCH TEMPLATE
  44.          
  45.                 $out = '';
  46.                 while($obj = mysqli_fetch_object($result))
  47.                 {
  48.                         $out .= $this->rowDesign($obj);
  49.                 }
  50.                 $out .= 'any required markup';
  51.                 return $out;
  52.      
  53.      }
  54.      
  55.      rowDesign($template, $obj)
  56.      {
  57.         SWITCH TEMPLATE
  58.        
  59.         the design for a single entry
  60.         return $rowMarkup
  61.      }
  62.      
  63.      simpleGet($which)
  64.      {
  65.         returns a basic query - returns a $obj or the result, ready to use.
  66.      }
  67.      simpleAdd($_REQUEST)
  68.      {
  69.         add a new entry
  70.      }
  71.      simpleUpdate($_REQUEST, $IDtoUpdate)
  72.      {
  73.         updates an entry
  74.      }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: