Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> do czego ta funkcja
bialy1500
post
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 9.02.2008

Ostrzeżenie: (0%)
-----


mam oto takie cos:


<?php

define("PERSIST", 1);
define("TEMP", 0);

class MysqlDB
{

var $connection;
var $status;
var $login;
var $pass;
var $address;
var $database;


function MysqlDB($con_type = TEMP) {
require("confdb.php");
$this->address = $address;
$this->login = $login;
$this->pass = $pass;
$this->database = $db;
if ($con_type == TEMP) $this->connection = mysql_connect($this->address, $this->login, $this->pass);
else $this->connection = mysql_pconnect($this->address, $this->login, $this->pass);
if (!$this->connection) $this->status = mysql_error();
else {
if (mysql_select_db($this->database, $this->connection))
$this->status = "Connected to database ".$this->database;
else $this->status = mysql_error();
}
}


function is_connected() {
if ($this->connection != "") {
$this->status = "Connected";
return true;
}
else {
$this->status = "Not connected!";
return false;
}
}

function query ($qe,$one=0) {
$tmp = NULL;
if ($this->is_connected()) {
$tmp = mysql_query($qe, $this->connection);
if ($tmp) $this->status = "Query executed";
else $this->status = mysql_error();
if ($one == 1) {
$tmp = mysql_fetch_array($tmp);
list($key, $value) = each($tmp);
$tmp = $value;
}
}
return $tmp;
}

function query_numrows ($qer) {
$tmp = $this->query ($qer);
if ($tmp) return mysql_num_rows($tmp);
else return NULL;
}

function query_affected_rows ($qer) {
$this->query ($qer);
return mysql_affected_rows($this->connection);
}

function insert_id() {
return mysql_insert_id($this->connection);
}

function close() {
mysql_close($this->connection);
}

}
?>
wiem ze to jest funkcja, ale jak by sie ktos orientowal to o dokladnie jej wyjasnienie co robi itp. z gory dziekuje
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
Piniek
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 463
Pomógł: 49
Dołączył: 27.12.2007
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


obsluga bazy danych winksmiley.jpg


--------------------
Go to the top of the page
+Quote Post
bialy1500
post
Post #3





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 9.02.2008

Ostrzeżenie: (0%)
-----


no tego sie domyslilem laugh.gif ale moze jakos dak bardziej dosadnie co za co odpowiada??
Go to the top of the page
+Quote Post
phpion
post
Post #4





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Odpowiada za obsługę bazy danych.
Go to the top of the page
+Quote Post
Piniek
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 463
Pomógł: 49
Dołączył: 27.12.2007
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


po nazwach funkcji popatrz to sie domyslisz


--------------------
Go to the top of the page
+Quote Post
bim2
post
Post #6





Grupa: Zarejestrowani
Postów: 1 873
Pomógł: 152
Dołączył: 9.04.2006
Skąd: Berlin

Ostrzeżenie: (0%)
-----


i po drugie to klasa z funkcjami smile.gif Taka nakładka na funkcje mysql_* :]


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 12:31