本文整理汇总了PHP中MySQL::InsertString方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQL::InsertString方法的具体用法?PHP MySQL::InsertString怎么用?PHP MySQL::InsertString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQL
的用法示例。
在下文中一共展示了MySQL::InsertString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetFullProfile
function SetFullProfile($Name, $Id_NTO)
{
$mysql = new MySQL();
if ($mysql->InsertString($this->NameBase, "NameTypeObject", array("name" => $Name, "Type" => "FP"))) {
$Id_NTOFP = $mysql->GetIdInsert();
if ($mysql->InsertString($this->NameBase, "FullProfile", array("Id_NTO" => $Id_NTO, "Id_NTOFP" => $Id_NTOFP))) {
conprint("SetFullProfile : " . $Name, "1");
return $Id_NTOFP;
} else {
conprint("SetFullProfile: " . $Name, "0");
return false;
}
} else {
conprint("SetFullProfile: " . $Name, "0");
}
}
示例2: SetSVG
function SetSVG($val, $Name)
{
$mysql = new MySQL();
$nameFile = "svg/" . date('YmdHis') . rand(100, 1000) . '.svg';
if ($mysql->InsertString($this->NameBase, "Maps", array("name" => $Name, "data" => $nameFile, "Type" => "svg"))) {
file_put_contents($nameFile, $val, FILE_APPEND);
conprint("SetSVG: " . $Name, "1");
return true;
}
}
示例3: SetObjectSmallData
function SetObjectSmallData($array, $Id_OBJ)
{
$mysql = new MySQL();
foreach ($array["params"] as $key => $value) {
if ($mysql->InsertString($this->NameBase, "SmallProfileData", array("text" => $value["text"], "Id_SP" => $value["id"], "Id_OBJ" => $Id_OBJ))) {
conprint("SetObjectSmallData Id_SP=" . $value["Id_SP"], "1");
} else {
conprint("SetObjectSmallData Id_SP=" . $value["Id_SP"], "0");
return false;
}
}
return true;
}
示例4: SetFullProfileData
function SetFullProfileData($table_name, $array)
{
$mysql = new MySQL();
foreach ($array as $key => $value) {
if ($mysql->InsertString($this->NameBase, $table_name, array("name" => $value["name"], "Id_OBJ" => $value["Id_OBJ"], "info" => $value["info"], "fotoURL" => $value["fotoURL"]))) {
conprint("SetFullProfileData С ИМЕНЕМ=" . $value["name"] . " В ТАБЛИЦЕ =" . $table_name, "1");
} else {
conprint("SetFullProfileData С ИМЕНЕМ=" . $value["name"] . " В ТАБЛИЦЕ =" . $table_name, "0");
return false;
}
}
return true;
}
示例5: SetUSER
function SetUSER($login, $password)
{
$mysql = new MySQL();
$err = array();
if (!preg_match("/^[a-zA-Z0-9@.]+\$/", $login)) {
$err[] = "Логин может состоять только из букв английского алфавита и цифр";
}
if (strlen($login) < 3 or strlen($login) > 30) {
$err[] = "Логин должен быть не меньше 3-х символов и не больше 30";
}
if ($this->FindLogin($login)) {
$err[] = "Пользователь с таким логином уже существует";
}
if (count($err) == 0) {
$password = md5(md5(trim($password)));
if ($mysql->InsertString($this->NameBase, "User", array("login" => $login, "password" => $password))) {
conprint("SetUSER: ", "1");
if ($mysql->CreateBaseData($login)) {
if ($mysql->CreateTable($login, "FullProfile", "id int(11) auto_increment primary key,Id_NTO int(11),Id_NTOFP int(11)")) {
if ($mysql->CreateTable($login, "Link", "id int(11) auto_increment primary key,Id_OBJ int(11),Id_MAP int(11),Id_MAPOBJ varchar(256)")) {
if ($mysql->CreateTable($login, "Maps", "id int(11) auto_increment primary key,name varchar(256),Type ENUM('svg','googlemaps'),data text")) {
if ($mysql->CreateTable($login, "NameTypeObject", "id int(11) auto_increment primary key,name varchar(256),Type ENUM('GL','FP')")) {
if ($mysql->CreateTable($login, "Objects", "id int(11) auto_increment primary key,name varchar(256),Id_NTO int(11),Id_OBJ int(11)")) {
if ($mysql->CreateTable($login, "SmallProfile", "id int(11) auto_increment primary key,name varchar(256),Id_NTO int(11),Type ENUM('Текст','Изображение')")) {
if ($mysql->CreateTable($login, "SmallProfileData", "id int(11) auto_increment primary key,text varchar(256),Id_SP int(11),Id_OBJ int(11)")) {
if ($mysql->CreateView($login, "FullData", "AS select `NameTypeObject`.`id` AS `id`,`NameTypeObject`.`name` AS `name`,`FullProfile`.`Id_NTO` AS `Id_NTO`,`FullProfile`.`id` AS `Id_FP` from (`NameTypeObject` join `FullProfile`) where (`NameTypeObject`.`id` = `FullProfile`.`Id_NTOFP`)")) {
if ($mysql->CreateView($login, "SmallData", " AS select `SmallProfileData`.`id` AS `id`,`SmallProfileData`.`text` AS `text`,`SmallProfileData`.`Id_SP` AS `Id_SP`,`SmallProfileData`.`Id_OBJ` AS `Id_OBJ`,`SmallProfile`.`name` AS `name`,`SmallProfile`.`Type` AS `Type` from (`SmallProfileData` join `SmallProfile`) where (`SmallProfileData`.`Id_SP` = `SmallProfile`.`id`)")) {
if ($mysql->CreateView($login, "LinkOBJ", " AS select `Link`.`id` AS `id`,`Link`.`Id_MAP` AS `Id_MAP`,`Link`.`Id_OBJ` AS `Id_OBJ`,`Link`.`Id_MAPOBJ` AS `Id_MAPOBJ`,`Objects`.`Id_NTO` AS `Id_NTO`,`Objects`.`name` AS `nameOBJ` from (`Link` join `Objects`) where (`Link`.`Id_OBJ` = `Objects`.`id`)")) {
return true;
}
}
}
}
}
}
}
}
}
}
}
} else {
conprint("SetLINK: ", "0");
return false;
}
}
}
示例6: SetLink
function SetLink($Id_MAP, $array)
{
$mysql = new MySQL();
foreach ($array as $key => $value) {
if ($value['id'] == 'null') {
if ($mysql->InsertString($this->NameBase, "Link", array("Id_MAP" => $value["Id_MAP"], "Id_OBJ" => $value["Id_OBJ"], "Id_MAPOBJ" => $value["Id_MAPOBJ"]))) {
conprint("SetLINK: ", "1");
} else {
conprint("SetLINK: ", "0");
return false;
}
} else {
if (!$this->PutLink($value['id'], $value['Id_OBJ'])) {
return false;
}
}
}
return true;
}
示例7: SetFullProfile
function SetFullProfile()
{
if (!empty($this->Name) && !empty($this->Id_NTO) && !empty($this->Type)) {
$mysql = new MySQL();
if ($mysql->InsertString("DataBase", "FullProfile", array("name" => $this->Name, "Id_NTO" => $this->Id_NTO, "type" => $this->Type, "name_table" => $this->Name . "_" . $this->Id_NTO))) {
conprint("СSetFullProfile : " . $this->Name, "1");
$mysql = new MySQL();
if ($mysql->CreateTable("DataBase", $this->Name . "_" . $this->Id_NTO, "id int(6) NOT NULL auto_increment, name varchar(256),Id_OBJ int(6),info varchar(256),fotoURL varchar(256), PRIMARY KEY (id)")) {
conprint("SetFullProfile: " . $this->Name, "1");
} else {
conprint("SetFullProfile: " . $this->Name, "0");
return false;
}
return true;
} else {
conprint("SetFullProfile : " . $this->Name, "0");
return false;
}
} else {
conprint("SetFullProfile Name или Id_NTO или Type не задано", "0");
return false;
}
}