- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
<?php require_once "db_config.php";
class db extends db_config {
private $connection;
function __construct(){
$this->open_connection();
// echo "Соединение установлено ";
}
private function open_connection(){
$this->connection=mysql_connect($this->DB_HOST,$this->DB_USER,$this->DB_PASS);
if (!$this-connection){
die("Соедитение с базой данных не установлено: ".mysql_error());
} else {
$db_select=mysql_select_db($this->DB_NAME);
if (!$db_select){
die("База данных не определена: ".mysql_error());
}
}
mysql_query("set names utf8")or die("set name utf8 failed");
mysql_query("set lc_time_names=ru_RU");
}
public function sql($query){
$result=mysql_query($query,$this->connection);
if (!result){
die("Запрос не выполнен: ".mysql_error());
}
return $result;
}
}
$db = new db();?>
sectus 10.03.2011 14:40 # 0
Vasiliy 10.03.2011 14:52 # 0
warider 10.03.2011 15:17 # 0
$db2 = new db();
$db3= new db();
одно подключение :~(
GhOsTMZ 10.03.2011 15:41 # 0
warider 10.03.2011 16:09 # 0
Vasiliy 10.03.2011 16:26 # −1
GhOsTMZ 10.03.2011 16:36 # 0
Vasiliy 10.03.2011 17:08 # −1
Это тут только по той простой причине что это позиционируется как сингелтон а на самом деле хрень собачия.
это на ... зачем private $connection; ???
это почему ?????
private function open_connection()
Я так думаю это с первого взгляда похоже на сингелтон. только все перепутано.
Приватным надо объявить конструктор
open_connection() это статичным
и в этом методе проверять было ли соединение или не было.
warider 10.03.2011 17:34 # +1
это обычный класс в котором реализовано соединение с бд и базовые функции для работы с ней.
GhOsTMZ 10.03.2011 17:41 # 0
Анонимус 10.03.2011 20:51 # 0
это самопальная (не pdo), кривая, с sql инеъкцией, заточенная на конкретную БД, совершенно бессмысленная якобы ООПшная обертка во круг функций mysql_query
ЗЫ: Синглтон он разве что в том смысле что имеет сайд эффект: mysql_select_db там глобальный
фейспалм, трижды фейспалм
bugmenot 10.03.2011 21:10 # 0
barop 22.01.2017 18:37 # −15
sectus 10.03.2011 15:53 # 0
guest 21.01.2017 22:28 # −16
most widely used wigs for African United states Females. Why? These are most all-natural-hunting. The truth is, the most popular <a href=http://wigsforwomenhuman.com/>Human Hair Wigs</a>
celebs who put on wigs - like Tyra Banks and Beyonce - choose African American top lace wigs.
Hold out... back... Tyra Banking institutions and Beyonce dress in wigs? Hi there, nearly anyone in Hollywood has donned locks that is certainly not her sooner or later or other! It is merely they use African United states top lace wigs, and that is why you <a href=http://www.wigsforblackwomen.in.net/>Wigs For Women</a>
can't notify. These wigs just appearance so organic!
So, why do these front lace wigs look so natural? Effectively, to begin with, permit it to be mentioned that <a href=http://wigsforwomenhuman.com/>Wigs For Women</a>
total lace wigs look even more normal than front lace wigs - full lace wigs could be styled in many different methods and also <a href=http://wigsforwomenhuman.com/>Wigs For Black Women</a>
put on up in ponytails without having appearing like a wig. Simply because the hairs of full lace wigs (and entrance lace wigs) are <a href=http://www.wigsforblackwomen.in.net/>Wigs</a>
separately associated with the lace.
guest 28.01.2017 06:21 # −15
most in-demand wigs for African Us Women. Why? Those are the most organic-hunting. In fact, the most popular <a href=http://wigsforblackwomensale.us/>Wigs For Sale</a>
celebs who wear wigs - like Tyra Banks and Beyonce - like African Us entrance lace wigs.
Hang on... back up... Tyra Banking companies and Beyonce use wigs? Hi there, practically every person in Hollywood has donned your hair which is not her very own eventually or other! It is merely that they wear African American front lace wigs, and that is certainly the reason why you <a href=http://www.wigsforblackwomen.in.net/>Wigs For Black Women</a>
can't tell. These wigs just look so normal!
So, why do these front lace wigs look so natural? Properly, firstly, let it be said that <a href=http://wigsforblackwomensale.us/>Wigs For Women</a>
complete lace wigs appear a lot more all-natural than front lace wigs - whole lace wigs may be designed in many different methods as well as <a href=http://wigsforblackwomensale.us/>Wigs For Sale</a>
donned up in ponytails with out resembling a wig. This is because the hairs of total lace wigs (and top lace wigs) are <a href=http://www.wigsforwomen.us.com/>Cheap Wigs</a>
individually associated with the lace.
guest 07.04.2017 20:07 # −15
suffering from baldness issues. It's also a powerful way to get yourself seem various with a dress-up costume party. Wigs are really easy to receive and rehearse plus they are useful at the same time. In today's instances, donning a new wig is not very an unpleasant experience. Wigs have advanced in a way <a href=http://www.wigsforwomen.us.com/>Wigs For Sale</a>
in order to go well with the particular altering requirements regarding individuals over time. Each manufactured along with natural splendor hair pieces are loved by women and men of numerous age range.
Varieties of African American Hairpieces
There are various forms of hair pieces you can purchase, the actual Dark hair pieces staying one of them. Hair pieces are available in different price ranges <a href=http://www.wigsshort.co/>Wigs For Women</a>
with respect to the item and it is content. Synthetic <a href=http://www.wigsfor-women.us.com/>Cheap Wigs</a>
fiber hair pieces be cheaper compared to real hair hairpieces since the second option appears more reasonable. Real human hair wigs are easy to sustain and therefore will be more well-known.
Swarthy complexioned individuals could go in for Dark-colored wigs within shades which will fit their own <a href=http://www.wigsforwomen.us.com/>Wigs For Black Women</a>
skin. They come in each darker in addition to lighter colors. However, the most famous Dark wig is the Ebony hairpiece that makes Black ladies appear gorgeous and gorgeous. These kind of hairpieces can be found in many styles similar to brief, extended, curly, curly, along with straight. The dimensions of your hairpiece is very important. You must examine the hairpiece cautiously before choosing <a href=http://www.shortwigs.org/>Wigs For Women</a>
to enable you to make sure that no body different features worn it before you.