Notice: Undefined variable: HTTP_HOST in D:\xampp\htdocs\tureta\public_html\index.php on line 3
Notice: Undefined variable: PHP_SELF in D:\xampp\htdocs\tureta\public_html\inc.config.php on line 175
Notice: Undefined variable: HTTP_HOST in D:\xampp\htdocs\tureta\public_html\inc.config.php on line 178
/* ---------------- 2003-11-28 ----------------
mysql class v 1.01
[+] prefix
[+] select() be parametru palaiko
-------------------------------------------- */
//automatiskai connectinasi jei nera susijungimo su $db["conn"]=connection(...), naujas objektas pagal default - 5ta pati connection
class mysql { //Change className => change constructor Name
//query => table all_caps
//table names without prefx???
var $table, //table_name
$name, //db_name
$conn, //id_conn
$type, //db_type
$host, //db_host
$user, //db_user
$pass, //db_pass
$pref; //db_pref
//CONSTRUCTOR
function mysql() { //
global $db, $tables;
if (!($this->table=@func_get_arg(0))) $this->table=$db["table"];
if (!($this->name =@func_get_arg(1))) $this->name =$db["name"];
if (!($this->conn =@func_get_arg(2))) $this->conn =$db["conn"];
if (!($this->type =@func_get_arg(4))) $this->type =$db["type"];
if (!($this->host =@func_get_arg(5))) $this->host =$db["host"];
if (!($this->user =@func_get_arg(6))) $this->user =$db["user"];
if (!($this->pass =@func_get_arg(7))) $this->pass =$db["pass"];
$this->pref =$db["pref"];
switch ($this->type) {
case "oracle": /*dar neaprasyta*/ break;
default :
if (!$this->conn) //create $db["conn"] !!! in global array
$db["conn"]=$this->conn=mysql_pconnect($this->host, $this->user, $this->pass)//
or die("Cant connect to hosting - ".$this->host.""); //, with username ".$this->db["user"]." and password ".$this->db["pass"]."
@mysql_select_db($this->name) or die("Can't select DB ".$this->name.""); //Yra trukumu
//Create table with prefix!!!
@mysql_query(str_replace(" ".$this->table." ", " ".$this->pref.$this->table." ", $tables[$this->table])); //Create tables, if their was droped (less than 0,0001 sek)
// mysql_query($tables[$this->table]); //Create tables, if their was droped (less than 0,0001 sek)
//echo "
".$this->conn;
break;
}
}
//INSERT "what" "values" ["query"] into ["table"] //Can't give array to method!!!!!
//Working: 1. ["query"]; 2. insert into ["table"] "id, nr" "$id, $nr"
function insert($what, $values, $query="", $table="") {
if (!@$table) $table=$this->table; //With default (class) table
$pref =$this->pref;
switch ($this->type) {
case "oracle": /*dar neaprasyta*/ break;
default :
//Sometimes need to delete before insert
if (@$query=str_replace(" $table ", " $pref$table ", $query." "))
@mysql_query($query);
// $values="'".str_replace(", ", "', '", $values)."'"; //"$id, $nr" => "'$id', '$nr'"
if (@mysql_query("insert into $pref$table ($what) values ($values)"))
return true; //Without errors
else
return false;
break;
}
}
//DELETE "where" from ["table"]
//Working: delete from ["table"] "where"
function delete($where, $table="") {
if (!@$table) $table=$this->table; //With default (class) table
$pref =$this->pref;
switch ($this->type) {
case "oracle": /*dar neaprasyta*/ break;
default :
if (@mysql_query("delete from $pref$table where ($where)"))
return true; //Sintax OK
else
return false;
break;
}
}
//SELECT "where" from ["table"]
//Working: select * from ["table"] "where"
function select($where="", $table="") {
if (!@$table) $table=$this->table; //With default (class) table
$pref =$this->pref;
if ($where) $where="WHERE ($where)"; //galima tuscia perduoti...
switch ($this->type) {
case "oracle": break; //dar neaprasyta
default :
if ($r=@mysql_query("SELECT * FROM $pref$table $where"))
return $r;
else
return false;
break;
}
}
//QUERY - select, delete, ins - optimalu ir neribotos galimybes
function query($query) {
global $tables;
$pref =$this->pref;
//Make prefix to all
for (reset($tables); $key=key($tables); next($tables)) {
$query=str_replace(" $key ", " $pref$key ", $query." "); //tarpas gale!!!
$query=str_replace(" $key.", " $pref$key.", $query); //Su tasku buna table.laukas
}
switch ($this->type) {
case "oracle": /*dar neaprasyta*/ break;
default : return $r=@mysql_query($query); break;
}
}
//DESTRUCTOR
function destructor() {
global $db; //!!!
switch ($this->type) {
case "oracle": /*dar neaprasyta*/ break;
default :
if (@mysql_close($this->conn)) unset($this->conn, $db["conn"]);
else echo "";
break;
}
}
// --- uzklausos rezultato isvedimas ---
function fetch_array($result) {
$this->record = mysql_fetch_array($result, MYSQL_ASSOC);
return $this->record;
}
function num_rows($result) { return ($result) ? mysql_num_rows($result) : 0; }
function num_fields($result) { return ($result) ? mysql_num_fields($result) : 0; }
function affected_rows() { return mysql_affected_rows($this->connection); }
}
?>
unset($LANG);
$LANG["search"]["lt"] = "Ieрkoti";
$LANG["search"]["en"] = "Search";
$LANG["search"]["ru"] = "Поиск";
$TEXT["placiau"]["lt"]= "plaиiau";
$TEXT["placiau"]["en"]= "more";
$TEXT["placiau"]["ru"] = "далее";
$LANG["words"]["lt"] = "Giria stiebш virр uosto stiebлs, Uю jш iрvydau bokрtus ir namus, Mus miestas sveikino рirdingai, Pakilo mostui mylima ranka, Ir virр manжs suskambo tлvo balsas: "Paюvelki, vaike - Klaipлda!"
/Agnese Miegel/";
$LANG["words"]["en"] = "A bunch of masts was standing above the city, I saw the houses and the towers behind them, The city greeted us sincerely, The dearest hand was waving, And I heard my father's voice which said: "Look, child, it's Klaipeda!"
/Agnese Miegel/";
$LANG["words"]["ru"] = "Лес стеблей вытянулся над портом, За ними вижу дома и башни, Нас город встречает сердечно, Взмахнуть поднялась любимая рука, И надо мной отцовский голос звучит: "Смотри, дитя - Клайпеда!"
Notice: Undefined variable: HTTP_REFERER in D:\xampp\htdocs\tureta\public_html\index.php on line 15
Notice: Undefined variable: HTTP_GET_VARS in D:\xampp\htdocs\tureta\public_html\index.php on line 18
Notice: Undefined variable: HTTP_GET_VARS in D:\xampp\htdocs\tureta\public_html\index.php on line 19
Notice: Undefined variable: HTTP_GET_VARS in D:\xampp\htdocs\tureta\public_html\index.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\tureta\public_html\inc.class.mysql.php:153) in D:\xampp\htdocs\tureta\public_html\index.php on line 22
Notice: Undefined variable: out in D:\xampp\htdocs\tureta\public_html\inc.config.php on line 392 Notice: Undefined variable: LANG in D:\xampp\htdocs\tureta\public_html\inc.head.php on line 2
- UAB "Tureta" Fatal error: Class 'mysql' not found in D:\xampp\htdocs\tureta\public_html\index.php on line 69