Subdomain Posts
None | 20 days ago
PHP | 276 days ago
None | 278 days ago
PHP | 278 days ago
PHP | 278 days ago
PHP | 278 days ago
PHP | 391 days ago
C# | 410 days ago
C# | 410 days ago
PHP | 410 days ago
Recent Posts
None | 10 sec ago
None | 17 sec ago
None | 53 sec ago
None | 59 sec ago
None | 1 min ago
None | 1 min ago
C++ | 1 min ago
mIRC | 1 min ago
None | 1 min ago
Java 5 | 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 mysql LOLCODE on the 16th of Jun 2009 10:10:41 PM Download | Raw | Embed | Report
  1. <?php
  2.  
  3. /**
  4.  * LOLCode
  5.  *
  6.  * @package LOLCode
  7.  * @author 3picM1ke
  8.  * @copyright 2009
  9.  */
  10. function DB( $sHost, $sUser, $sPass, $sDb )
  11. {
  12.        
  13.         $rConn = mysql_connect( $sHost, $sUser, $sPass ) or die( mysql_error( ) );
  14.         mysql_select_db( $sDb, $rConn ) or die( mysql_error( ) );
  15.        
  16. }
  17.  
  18. function ASK( $sQuery )
  19. {
  20.        
  21.         $aSearch = array( 'CAN I PLZ GET', 'ALL UP IN', 'OMG', 'ZORT BY', 'NO MORE THAN', 'PLZ ADD TO', 'MAKE', ' IZ ', ' N ' );
  22.         $aReplace = array( 'SELECT', 'FROM', 'WHERE', 'ORDER BY', 'LIMIT', 'INSERT INTO', 'SET', ' = ', ' AND ' );
  23.    
  24.     // Not inside single quotes (strings)
  25.     $aQuotes = explode( "'", $sQuery );
  26.    
  27.     foreach( $aQuotes as $nKey => $sQuote )
  28.     {
  29.        
  30.         if( ( $nKey % 2 ) == 0 )
  31.         {
  32.            
  33.             $aQuotes[ $nKey ] = str_replace( $aSearch, $aReplace, $sQuote );
  34.                    
  35.         }
  36.            
  37.     }
  38.        
  39.         $sQuery = implode( "'", $aQuotes );
  40.        
  41.         $rResult = mysql_query( $sQuery ) or die( mysql_error( ) );
  42.        
  43.         return $rResult;
  44.        
  45. }
  46.  
  47. function MUCH( $rResult )
  48. {
  49.        
  50.         return mysql_num_rows( $rResult );
  51.        
  52. }
  53.  
  54. function DBUCKET( $rResult )
  55. {
  56.        
  57.         return mysql_fetch_assoc( $rResult );
  58.        
  59. }
  60.  
  61. ?>
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: