Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/topic.php on line 737
PHP.SU ::

 PHP.SU

PHP, MySQL -
PHP.SU                                      


  (1): [1]   

> 
7erj
: 26 , 2015 - 14:50:06
Post Id







: 84
-: . 2015  
: ,


: 1 ()




, . dle 10.0 include php , :

PHP:

  1. //MAIN_VARIABLE
  2. $ipconfig = ip2long($_SERVER['REMOTE_ADDR']);
  3.  
  4. //HOSTS
  5. class FirstServ{
  6. var $dsn = 'mysql:dbname=abills;host=localhost';
  7. var $user = 'root';
  8. var $password = '';
  9. }
  10. $first_serv = new FirstServ;
  11. //OPERATION (cycle fon first server)
  12. $pdo = new PDO($first_serv->dsn, $first_serv->user, $first_serv->password);
  13. $result = $pdo->query("SELECT * FROM bills
  14.                                                                                         JOIN dv_main ON bills.uid = dv_main.uid
  15.                                                                                         JOIN users_bruteforce ON dv_main.ip = users_bruteforce.ip
  16.                                                                                         JOIN users_pi ON bills.uid = users_pi.uid
  17.                                                                                         ");
  18. foreach ($result as $row) {
  19. $abon_ip = $row['ip'];
  20. $abon_login = $row['login'];
  21. $deposit = $row['deposit'];
  22. $fio = $row['fio'];
  23.  
  24. if($ipconfig == $abon_ip){
  25.  
  26. echo trim($fio);
  27. }
  28. else{}
  29. }


:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't assign requested address' in /var/local/unet.co/engine/modules/query.php:13 Stack trace: #0 /var/local/unet.co/engine/modules/query.php(13): PDO->__construct('mysql:dbname=ab...', 'root', '') #1 /var/local/unet.co/engine/classes/templates.class.php(200): include('/var/local/unet...') #2 [internal function]: dle_template->load_file(Array) #3 /var/local/unet.co/engine/classes/templates.class.php(474): preg_replace_callback('#\\{include file...', Array, 'compile('main') #5 {main} thrown in /var/local/unet.co/engine/module s/query.php on line 13


-----
trust me i'm an engineer
 
My status
 Top
DeepVarvar
: 26 , 2015 - 14:59:15
Post Id







: 10377
-: . 2008  
:


: 353 ()




PHP:

  1. try {
  2.   //
  3. } catch (PDOException $e) {
  4.     echo $e->getMessage();
  5. }


-----
? ?
 
 Top
7erj
: 26 , 2015 - 15:05:14
Post Id







: 84
-: . 2015  
: ,


: 1 ()




DeepVarvar, : SQLSTATE[HY000] [2002] Connection refused
, ?
()
, . host
!


-----
trust me i'm an engineer
 
My status
 Top
7erj
: 26 , 2015 - 18:06:52
Post Id







: 84
-: . 2015  
: ,


: 1 ()




, .
utf-8, windows-1251.
( ) , : вановичАренда БА ВИНОВКААренда Б

____
@mysql_query("SET names cp1251");
, -


-----
trust me i'm an engineer
 
My status
 Top
MiksIr
: 26 , 2015 - 18:35:53
Post Id






: 378
-: . 2014  


: 10 ()

[+]


(). , . 1251, utf - set names


-----
self-banned
 
 Top
7erj
: 26 , 2015 - 19:13:51
Post Id







: 84
-: . 2015  
: ,


: 1 ()




MiksIr
( )
.PNG


-----
trust me i'm an engineer
 
My status
 Top
MiksIr
: 26 , 2015 - 19:25:31
Post Id






: 378
-: . 2014  


: 10 ()

[+]


utf8 ? - . utf8 utf8 - set names .


-----
self-banned
 
 Top
7erj
: 26 , 2015 - 19:29:43
Post Id







: 84
-: . 2015  
: ,


: 1 ()




MiksIr :
utf8 ? - . utf8 utf8 - set names .

: $pdo->query("SET NAMES cp1251");
, , :
()
utf-8
10.4 . . ++ -8 . - .
( )
.PNG


-----
trust me i'm an engineer
 
My status
 Top
(1): [1]
: 0 (: 0, : 0)
« »


.
.
.
 



Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB