All pastes #350861 Raw Edit

Something

public text v1 · immutable
·published 2007-02-11 20:04 UTC
rendered paste body
<?php
	
	
	class revo {
	
		var $table;
		var $id;
		var $title;
		var $imggroup;
		var $text;
		var $dDate;
		
		function revo(){
		}
		
		function setData($tName,$tiName,$iGroup,$txtName,$ivalue="", $dDate = ""){
			$this->table = $tName;
			$this->title = $tiName;
			$this->imggroup = $iGroup;
			$this->text = $txtName;
			
			if($ivalue != ""){
				$this->id = $ivalue;
			}
			
			if($dDate != ""){
				$this->dDate = $dDate;
			}
		}
		
		function insertData($title, $imggroup, $text, $date=""){
			include 'config.php';
			include 'functions.php';
			$stat = "";
			$dbcon = db_con();
			$sql = "INSERT INTO " . $dbname . "." . $this->table . " SET " . $this->title . "=\"" . $title . "\", " . $this->imggroup . "=\"" . $imggroup . "\", " . $this->text . "=\"" . $text . "\"" ;
					if($this->dDate !=""){
						if($date !=""){
							$sql = $sql . ", " . $this->dDate . "=\"" . $date . "\"";
						}
					}
			$dbact = mysql_query($sql);
				if(!$dbact){
					$stat = "Error with Revo() class inserData <br> Error: " . mysql_error() ;
					mysql_close($dbcon);
					return $stat;
				} else {
					$stat = "Inserted data into " . $this-table . " successfully!";
					mysql_close($dbcon);
					return $stat;
				}

		}
		
		function pullData($id="", $limit="", $field="",$fSorot="",$sBy=""){
			include 'config.php';
			include 'functions.php';
			
				if($id == "" && $limit == "" && $field == "" && $fSort == "" && $sBy ==""){
					$sql = "SELECT * FROM " . $dbname . "." $this->table . " ORDER BY " . $this->id . " DESC"; 
				}
				
				if($limit != "" && $field !="" && $fsort != "" ){
				
					0
					
					
				}
			
		
		}
		
	
	
	}




?>