0
0
Xoş gəldin, Qonaq
Master Forum | Arxiv Mövzular | Arxiv 1
  mysql Yazmaq
SysTeMeXe SysTeMeXe [Off] [#] (18.08.2016 / 00:26)
Salam bu zibilde mysql Hara Yazilir ?

<?php
ob_start();
session_start();
$mc = mysql_connect('localhost', 'root', '') or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc);
mysql_select_db('koderok4', $mc) or die('No dostuba bazası');

include 'inc/word-count.class.php';

if(isset($_COOKIE['login'])){
$req = mysql_query("SELECT * FROM `users` WHERE `login` = '".$_COOKIE['login']."'");
$login = mysql_fetch_array($req);
}
if(!empty($login['id'])){
mysql_query("UPDATE `users` SET `lastvizit` = '".time()."' WHERE `id` = '".$login['id']."'");
}

function transrus($t){
$t = str_replace('!','',$t);
$a = array('_','YA','Ya','ya','yee','YO','yo','Yo','ZH','zh','Zh','Z','z','CH','ch','Ch','SH','sh','Sh','YE','ye','Ye','YU','yu','Yu','JA','ja','Ja','A','a','B','b','V','v','G','g','D','d','E','e','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','R','r','S','s','T','t','U','u','F','f','H','h','W','w','x','q','Y','y','C','c','!');
$b = array(' ','Я','Я','я','ые','Ё','ё','Ё','Ж','ж','Ж','З','з','Ч','ч','Ch','Ш','ш','Ш','Э','э','Э','Ю','ю','Ю','Я','я','Я','А','а','Б','б','В','в','Г','г','Д','д','Е','е','И','и','Й','й','К','к','Л','л','М','м','Н','н','О','о','П','п','Р','р','С','с','Т','т','У','у','Ф','ф','Х','х','Щ','щ','ъ','ь','Ы','ы','Ц','ц','');
return str_replace($a,$b,$t);
}

function transen($t){
$a = array('_','YA','Ya','ya','yee','YO','yo','Yo','ZH','zh','Zh','Z','z','CH','ch','Ch','SH','sh','Sh','YE','ye','Ye','YU','yu','Yu','JA','ja','Ja','A','a','B','b','V','v','G','g','D','d','E','e','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','R','r','S','s','T','t','U','u','F','f','H','h','W','w','x','q','Y','y','C','c','!');
$b = array(' ','Я','Я','я','ые','Ё','ё','Ё','Ж','ж','Ж','З','з','Ч','ч','Ch','Ш','ш','Ш','Э','э','Э','Ю','ю','Ю','Я','я','Я','А','а','Б','б','В','в','Г','г','Д','д','Е','е','И','и','Й','й','К','к','Л','л','М','м','Н','н','О','о','П','п','Р','р','С','с','Т','т','У','у','Ф','ф','Х','х','Щ','щ','ъ','ь','Ы','ы','Ц','ц','');
return str_replace($b,$a,$t);
}

function format_size($size){
$metrics[0] = 'байт';
$metrics[1] = 'Кбайт';
$metrics[2] = 'Мбайт';
$metrics[3] = 'Гбайт';
$metrics[4] = 'Тбайт';
$metric = 0;
while(floor($size/1024) > 0){
++$metric;
$size /= 1024;
}
$ret = round($size,1)." ".(isset($metrics[$metric])?$metrics[$metric]:'??');
return $ret;
}

function mysql_size(){
$result = mysql_query("SHOW TABLE STATUS");
$dbsize = 0;

while( $row = mysql_fetch_array( $result ) )
{
$dbsize += $row["Data_length"] + $row["Index_length"];
}

return $dbsize;
}


function dir_size($dirname) {
$totalsize=0;
if ($dirstream = @opendir($dirname)) {
while (false !== ($filename = readdir($dirstream))) {
if ($filename!="." && $filename!="..")
{
if (is_file($dirname."/".$filename))
$totalsize+=filesize($dirname."/".$filename);

if (is_dir($dirname."/".$filename))
$totalsize+=dir_size($dirname."/".$filename);
}
}
}
closedir($dirstream);
return $totalsize;
}

class page

{

public $num;

public $page;

public $posts;

public $post;

public $total;



public static function pg_num ($nm, $tb)

{

global $mysqli;

$num = $nm;

$page = $GLOBALS['_GET']['page'];

$req = mysql_query("SELECT COUNT(*) FROM $tb");
$post = mysql_fetch_array($req);

$posts=$post['0'];

$total = intval(($posts - 1) / $num) + 1;

$page = intval($page);

if(empty($page) or $page < 0) $page = 1;

if($page > $total) $page = $total;

$start = $page * $num - $num;



return array("num" => $num, "page" => $page, "total" => $total, "start" => $start);

}

/* End function pg_num */

public static function pg_str($url, $page, $total)

{

/*
if ($page != 1){$pervpage = '<a class="page_a" href='.$url.'page=1> В Начало </a><a class="page_a" href='.$url.'page='. ($page - 1) .'> ireli </a>';}

if ($page != $total){$nextpage = '<a class="page_a" href='.$url.'page='. ($page + 1) .'> Вперёд </a><a class="page_a" href='.$url.'page=' .$total. '> В Конец </a>';}

*/

if($page - 2 > 0) $page2left = ' <a class="page_a" href='.$url.''. ($page - 2) .'>'. ($page - 2) .'</a>';

if($page - 1 > 0) $page1left = '<a class="page_a" href='.$url.''. ($page - 1) .'>'. ($page - 1) .'</a>';

if($page + 2 <= $total) $page2right = '<a class="page_a" href='.$url.''. ($page + 2) .'>'. ($page + 2) .'</a>';

if($page + 1 <= $total) $page1right = '<a class="page_a" href='.$url.''. ($page + 1) .'>'. ($page + 1) .'</a>';

echo '<div class="menu">'.$pervpage.$page2left.$page1left.'<span class="page_b">'.$page.'</span>'.$page1right.$page2right.$nextpage.'</div>';

}

/* End function pg_num */
}




class page_admin

{

public $num;

public $page;

public $posts;

public $post;

public $total;



public static function pg_num_admin ($nm, $tb)

{

global $mysqli;

$num = $nm;

$page = $GLOBALS['_GET']['page'];

$req = mysql_query("SELECT COUNT(*) FROM $tb");
$post = mysql_fetch_array($req);

$posts=$post['0'];

$total = intval(($posts - 1) / $num) + 1;

$page = intval($page);

if(empty($page) or $page < 0) $page = 1;

if($page > $total) $page = $total;

$start = $page * $num - $num;



return array("num" => $num, "page" => $page, "total" => $total, "start" => $start);

}

/* End function pg_num */

public static function pg_str_admin($url, $page, $total)

{

/*
if ($page != 1){$pervpage = '<a class="page_a" href='.$url.'page=1> В Начало </a><a class="page_a" href='.$url.'page='. ($page - 1) .'> Назад </a>';}

if ($page != $total){$nextpage = '<a class="page_a" href='.$url.'page='. ($page + 1) .'> Вперёд </a><a class="page_a" href='.$url.'page=' .$total. '> В Конец </a>';}

*/

if($page - 2 > 0) $page2left = ' <a class="page_a" href='.$url.''. ($page - 2) .'>'. ($page - 2) .'</a>';

if($page - 1 > 0) $page1left = '<a class="page_a" href='.$url.''. ($page - 1) .'>'. ($page - 1) .'</a>';

if($page + 2 <= $total) $page2right = '<a class="page_a" href='.$url.''. ($page + 2) .'>'. ($page + 2) .'</a>';

if($page + 1 <= $total) $page1right = '<a class="page_a" href='.$url.''. ($page + 1) .'>'. ($page + 1) .'</a>';

echo '<div class="menu">'.$pervpage.$page2left.$page1left.'<span class="page_b">'.$page.'</span>'.$page1right.$page2right.$nextpage.'</div>';

}

/* End function pg_num */


}
function text($str) {

$q=mysql_query("SELECT * FROM `smiles` ORDER BY `id` ASC");
while($post=mysql_fetch_array($q)){
$n=explode(',',$post['name']);
$nn=NULL;
foreach($n as $key => $value){
$str=str_replace($value,"<img src='/files/smiles/$post[file]' alt='o'/>",$str);
}
}
return $str;
}



function utf8_substr($str, $offset, $length = null)
{
#в начале пробуем найти стандартные функции
if (function_exists('iconv_substr'))
{
#(PHP 5)
return iconv_substr($str, $offset, $length, 'utf-8');
}
if (function_exists('mb_substr'))
{
#(PHP 4 >= 4.0.6, PHP 5)
return mb_substr($str, $offset, $length, 'utf-8');
}
preg_match_all('~[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
~xs', $str, $m);
if ($length !== null)
{
$a = array_slice($m[0], $offset, $length);
}
else
{
$a = array_slice($m[0], $offset);
}
return implode('', $a);
}

function time_left($tl)
{
$d=3600*24;
$day=floor($tl/$d);
$tl=$tl-($d*$day);

$hour=floor($tl/3600);
$tl=$tl-(3600*$hour);

$minute=floor($tl/60);
$tl=$tl-(60*$minute);

$second=floor($tl);

$dayt="".($day>0?"<span class='timer_day'>$day д.</span> ":null)."";
$hourt="".($hour>0?"<span class='timer_hour'>$hour ч.</span> ":null)."";
$minutet="".($minute>0?"<span class='timer_minute'>$minute м.</span> ":null)."";
$secondt="".($second>0?"<span class='timer_second'>$second с.</span> ":null)."";
if($day>0)
{
$minutet=NULL;
$secondt=NULL;
}
if($hour>0 && $day==0)
{
$secondt=NULL;
$dayt=NULL;
}
return "$dayt$hourt$minutet$secondt назад";
}
$req_del = mysql_query("SELECT `bad`,`id`,`file` FROM `files` WHERE `bad` >= 50");
while($del_bad = mysql_fetch_array($req_del)){

unlink('files/videos/'.$del_bad['file']);
mysql_query("DELETE FROM `files` WHERE `id` = '".$del_bad['id']."'");

}

$req_del_foto = mysql_query("SELECT `bad` FROM `files_foto` WHERE `bad` >= 50");
while($del_bad_foto = mysql_fetch_array($req_del_foto)){
unlink('files/videos/'.$del_bad_foto['file']);
mysql_query("DELETE FROM `files_foto` WHERE `id` = '".$del_bad_foto['id']."'");
}
SoxulcanPRO  SoxulcanPRO (SV!) [Off] [#] (18.08.2016 / 00:30)
Qrablarin hazirlamasi
  1. $mc = mysql_connect('localhost', 'baza____adi', '') or die('MySQL üçün No dostuba');
  2. mysql_set_charset('utf8',$mc);
  3. mysql_select_db('PArol', $mc) or die('No dostuba bazası');


olmasa demki nese silinib ordan dbpass kimi bir weyler olmali idi
SysTeMeXe SysTeMeXe [Off] [#] (18.08.2016 / 00:32)
# SoxulcanPRO (18.08.2016 / 00:30)
$mc = mysql_connect('localhost', 'baza____adi', '') or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc);
mysql_select_db('PArol', $mc) or die('No dostuba bazası');



olmasa demki nes
Hele yazdim Alinmadi :))
Tuncay Tuncay [Off] [#] (18.08.2016 / 00:33)
$mc = mysql_connect('localhost', 'root', '') or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc);
mysql_select_db('koderok4', $mc) or die('No dostuba bazası');

Koderok4 parol ora
Utf8 loqin ora bax da qalan seyleri de uygunlasdir ele :D

Nese sehf eledimse usrlu say 1 ilsi mesqul olmurdum bi isle :D
SoxulcanPRO  SoxulcanPRO (SV!) [Off] [#] (18.08.2016 / 00:37)
Qrablarin hazirlamasi
  1. $mc = mysql_connect('localhost','Baza_Adi','Baza_Adi') or die('MySQL ucun No dostuba');
  2. mysql_set_charset('utf8',$mc);
  3. mysql_select_db('Parolll', $mc) or die('No dostuba bazas?');


indi yoxla
SysTeMeXe SysTeMeXe [Off] [#] (18.08.2016 / 00:41)
# SoxulcanPRO (18.08.2016 / 00:37)
$mc = mysql_connect('localhost','Baza_Adi','Baza_Adi') or die('MySQL ucun No dostuba');
mysql_set_charset('utf8',$mc);
mysql_select_db('Parolll', $mc) or die('No dostuba bazas?');



indi yoxla
MySQL ucun No dostuba
SoxulcanPRO  SoxulcanPRO (SV!) [Off] [#] (18.08.2016 / 00:45)
Qrablarin hazirlamasi
# SysTeMeXe (18.08.2016 / 00:41)
MySQL ucun No dostuba
qaqa belke install yolu var bunun
SysTeMeXe SysTeMeXe [Off] [#] (18.08.2016 / 00:48)
# SoxulcanPRO (18.08.2016 / 00:45)
qaqa belke install yolu var bunun
Sayti Senen Yazsam baxa bilersen Parolu logini ?
StarN!cK StarN!cK [Off] [#] (18.08.2016 / 00:52)
# SysTeMeXe (18.08.2016 / 00:26)
Salam bu zibilde mysql Hara Yazilir ?

<?php
ob_start();
session_start();
$mc = mysql_connect('localhost', 'root', '') or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc);
mysq
wp yazdım cavab ver zehmet deyilse qaqa :)
CoDiNG* CoDiNG* (FMod) [Off] [#] (18.08.2016 / 01:46)
Salam.buyur:

$db_user='baza_adi';
$db_name='baza_adi';
$db_pass='bazaparolu';
$mc = mysql_connect('localhost', $db_user, $db_pass) or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc);
mysql_select_db($db_name, $mc) or die('No dostuba bazası');
SysTeMeXe SysTeMeXe [Off] [#] (18.08.2016 / 06:44)
# CoDiNG* (18.08.2016 / 01:46)
Salam.buyur:

$db_user='baza_adi';
$db_name='baza_adi';
$db_pass='bazaparolu';
$mc = mysql_connect('localhost', $db_user, $db_pass) or die('MySQL üçün No dostuba');
mysql_set_charset('utf8',$mc)
Tewekur qaqa :)))

Movzu Off
  mysql Yazmaq
Cəmi: 11 Cavab
Mövzunu vip et
Mövzuya Baxanlar (39 nəfər)
Müellife göre filtreleme
Mövzunu Yükle

mysql Yazmaq

mysql Yazmaq

Rol.Az