(6): [1] 2 3 4 5 6 »
: 86
karamba
: 21 , 2016 - 19:50:59 • : • : -
: 18 : 4509
: karamba : ? . . logAdd(), .
, , , 100000 , .
PHP:
<?PHP
abstract class Super {
abstract function whoAmI( ) ;
}
class A extends Super {
function whoAmI( ) {
return "A" ;
}
}
class B extends Super {
function whoAmI( ) {
return "B" ;
}
}
$a = new A( ) ;
$b = new B( ) ;
foreach ( $array as & $value ) {
echo $value -> whoAmI ( ) ;
}
?>
"AB", . .
karamba
: 20 , 2016 - 09:17:32 • : • : -
: 18 : 4509
? ?
karamba
: 19 , 2016 - 19:53:50 • : • : -
: 18 : 4509
Bio man : __construct0 ?
. , .
, -
https://www.youtube.com/user/pro100fox2/playlists
__construct0 ? . PHP .
? . . logAdd(), .
karamba
: 19 , 2016 - 17:38:38 • : • : -
: 18 : 4509
, , .
, mysqli , PDO.
log , write, .
, ?
karamba
: 19 , 2016 - 12:49:30 • : • : -
: 18 : 4509
Bio man :
.
- Logger: .
- DBLogger: Logger .
DBLogger ( PDO) , PDO .
!
. , .
. , . , , , . ?
DBLogger PDO , , , . , PDO, .
? PDO ?
PHP:
<?PHP
abstract class Logger {
abstract protected function logAdd( $entry ) ;
}
class DBLogger extends Logger{
private $DBH ;
function __construct( ) {
}
}
private function __construct0( ) {
try {
$this -> DBH = new PDO( "mysql:host=localhost;dbname=log" , 'root' , '' ) ;
}
catch( PDOException $e ) {
echo $e -> getMessage ( ) ;
}
}
private function __construct4( $host , $dbname , $user , $pass ) {
try {
$this -> DBH = new PDO( "mysql:host=$host ;dbname=$dbname " , $user , $pass ) ;
}
catch( PDOException $e ) {
echo $e -> getMessage ( ) ;
}
}
function logAdd( $entry ) {
try {
$STH = $this -> DBH -> prepare ( "INSERT INTO log (log) values (?)" ) ;
$STH -> bindParam ( 1, $entry ) ;
$STH -> execute ( ) ;
}
catch( PDOException $e ) {
echo $e -> getMessage ( ) ;
}
}
}
$dbLog = new DBLogger( ) ;
$dbLog -> logAdd ( "I use OOP" ) ;
?>
karamba
: 16 , 2016 - 21:47:38 • : • : -
: 18 : 4509
. , . . ....
:
: ( ) .
- stdout, mysql, . ( )
- mysql,
- :
* ( YYYY-MM-DD HH:MM:SS)
* (, , , )
PHP .
- .
( ).
. MySQL
CODE (
htmlphp ):
class LogDB {
private $host = 'localhost' ;
private $database = 'log' ;
private $user = 'root' ;
private $password = '' ;
function __construct( ) {
}
}
private function __construct4( $host , $database , $user , $password ) {
$this -> host = $host ;
$this -> database = $database ;
$this -> user = $user ;
$this -> password = $password ;
}
public function logAdd( $entry ) {
$mysqli = new mysqli( $this -> host , $this -> user , $this -> password , $this -> database ) ;
if ( $mysqli -> connect_error ) {
die ( 'Connect Error (' . $mysqli -> connect_errno . ') ' . $mysqli -> connect_error ) ; }
$mysqli -> set_charset ( "utf8" ) ;
$mysqli -> query ( "insert into log (log) values('$entry ')" ) ;
if ( $mysqli -> errno ) {
die ( 'INSERT Error (' . $mysqli -> errno . ') ' . $mysqli -> error ) ; }
$mysqli -> close ( ) ;
}
}
- . ? ,
karamba
: 06 , 2015 - 15:25:10 • : NOT IN • : SQL
: 6 : 62
: .
:
MariaDB: 10.0.22-MariaDB-0+deb8u1
PMA: 4.2.12deb2+deb8u1
PHP libmysql - 5.5.46
:
CODE (
SQL ):
CREATE TABLE `category` (
`id` int( 10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`parent_category_id` int( 10) UNSIGNED DEFAULT NULL ,
`name` varchar( 30) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE= InnoDB
- .
, , PMA
. . XAMMP . NOT IN . , , .
karamba
: 05 , 2015 - 22:17:34 • : NOT IN • : SQL
: 6 : 62
SQL MySQL MariaDB. <> ALL .
: NOT IN is an alias for <> ALL.
, NOT IN <> ALL.
SQL phpMyAdmin
karamba
: 05 , 2015 - 19:55:48 • : NOT IN • : SQL
: 6 : 62
: . MySQL, - ?
NOT IN (subquery) , <> ALL: http://dev.mysql.com/doc/refman/5.7/en/all-subqueries.html
: MariaDB
: 10.0.17-MariaDB - mariadb.org binary distribution
: 10
karamba
: 04 , 2015 - 22:13:57 • : NOT IN • : SQL
: 6 : 62
,
2 .
. (near "NOT IN" at position 34)
. (near "(" at position 41)
CODE (
SQL ):
SELECT * FROM `category` WHERE id NOT IN ( SELECT `parent_category_id` FROM `category` WHERE `parent_category_id` IS NOT NULL )
NOT,
CODE (
SQL ):
SELECT * FROM `category` WHERE id IN ( SELECT `parent_category_id` FROM `category` WHERE `parent_category_id` IS NOT NULL )
CODE (
SQL ):
SELECT * FROM `category` WHERE id NOT IN ( 1 , 2 , 3 )
karamba
: 17 , 2015 - 14:04:39 • : mail • :
: 0 : 208
mail (XAMPP for Windows 5.6.14)
php.ini:
: sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
: ;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
sendmail.ini:
: ; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail
[sendmail]
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.
smtp_server=smtp.mail.ru
; smtp port (normally 25)
smtp_port=25
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=auto
; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify
default_domain=mail.ru
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
auth_username=my.mail@mail.ru
auth_password=my.password
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines. do not enable unless it is required.
;pop3_server=pop.mail.ru
;pop3_username=my.mail@mail.ru
;pop3_password=my.password
; force the sender to always be the following email address
; this will only affect the "MAIL FROM" command, it won't modify
; the "From: " header of the message content
force_sender=my.mail@mail.ru
; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify
; the "To: " header of the message content
force_recipient=
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required
hostname=mail.ru
PHP:
PHP:
<?PHP
$to = 'karamba@mail.ru' ;
$subject = 'Theme of letter' ;
$message = 'Text of letter' ;
if ( mail ( $to , $subject , $message ) ) echo " " ; else echo " " ;
?>
, " "
debug.log:
: 15.11.17 14:43:41 ** Connecting to smtp.mail.ru:25
15.11.17 14:43:42 ** Authenticating as my.mail@mail.ru
15.11.17 14:43:42 ** Disconnecting from smtp.mail.ru:25
15.11.17 14:43:42 ** Connection Closed Gracefully.
15.11.17 14:44:37 ** --- MESSAGE BEGIN ---
15.11.17 14:44:37 ** To: karamba@mail.ru
15.11.17 14:44:37 ** Subject: Theme of letter
15.11.17 14:44:37 ** X-PHP-Originating-Script: 0:contact.php
15.11.17 14:44:37 **
15.11.17 14:44:37 ** Text of letter
15.11.17 14:44:37 ** --- MESSAGE END ---
15.11.17 14:44:39 ** Connecting to smtp.mail.ru:25
15.11.17 14:44:39 ** Connected.
15.11.17 14:44:39 << 220 smtp34.i.mail.ru ESMTP ready<EOL>
15.11.17 14:44:39 >> EHLO mail.ru<EOL>
15.11.17 14:44:39 << 250-smtp34.i.mail.ru<EOL>250-SIZE 73400320<EOL>250-8BITMIME<EOL>250-PIPELINING<EOL>250-AUTH PLAIN LOGIN XOAUTH2<EOL>250 STARTTLS<EOL>
15.11.17 14:44:39 ** Authenticating as my.mail@mail.ru
15.11.17 14:44:39 >> STARTTLS<EOL>
15.11.17 14:44:39 << 220 2.0.0 Start TLS<EOL>
15.11.17 14:44:39 >> QUIT<EOL>
15.11.17 14:44:39 << Q MVK$WSB& HaۄvQ ?a>ߵ(i M,2 9 00Πw:Z$0
*H
0D10 UUS10U
GeoTrust Inc.10UGeoTrust SSL CA - G20
150827000000Z
160826235959Z0r10 URU10URUSSIAN FEDERATION10
UMoscow10U
LLC Mail.Ru10 UIT10U *.mail.ru0"0
*H
0
ep_& b(=Q6֬82u+Oݫ;ྵbbxXrn4Q 5N_'zYGZ`tn!?)]DRS
C9KpEWbIF*)%#wŒ}r_5 KJ~LJ]g:ZT$!Zsio+!G<\N1f~%JD9 d7.mKYa 00U0 *.mail.rumail.ru0 U0 0U0+U$0"0
http://gb[dot]symcb[dot]com/gb[dot]crl0U 00g00?+3https://
www[dot]geotrust[dot]com/resources/repos[dot][dot][dot]al0A+05 3https://www.geotrust.com/resources/repository/legal0U%0++0U#0Js9[i\=dU0W+K0I0+0
http://gb[dot]symcd[dot]com0&+[dot][dot][dot]ymcb[dot]com/gb[dot]crt0
*H
{noCX :Sj?93tIv6p8C|2e&zrPHq'Ν"r dk_3IlpgE[W31\rtsӫŭ5j!H ZƗ\,])98G;$vf&<Z}Z-G
Wz6ehTVZT벐'RE-@dBW;Aׁ[|-Y"⭢00$$$:ܟ
(O ]0Y0A:c0
*H
0B10 UUS10U
GeoTrust Inc.10UGeoTrust Global
15.11.17 14:44:39 ** Disconnected.
15.11.17 14:44:39 ** Disconnecting from smtp.mail.ru:25
15.11.17 14:44:39 ** Disconnected.
15.11.17 14:44:39 ** Disconnected.
15.11.17 14:44:39 ** Connection Closed Gracefully.
?
karamba
: 28 , 2014 - 21:14:39 • : • : HTML, & CSS
: 2 : 755
HTML UTF-8
CODE (
html ):
<meta http-equiv = "content-type" content = "text/html; charset=utf-8" >
.
CODE (
html ):
<meta http-equiv = "content-type" content = "text/html; charset=utf-8" >
, ANSI, .
karamba
: 28 , 2014 - 20:48:13 • : • : HTML, & CSS
: 2 : 755
jquery ( ).
Opera .
IE .
HTML utf-8.
utf-8 , . ?
karamba
: 28 , 2012 - 10:46:46 • : xampp PostgreSQL • :
: 4 : 4702
PostgreSQL.
XAMPP 1.7.7 PHP 5.3.8.
postgresql-9.1.1-1.
PHP PostgreSQL:
CODE (
html ):
Fatal error: Call to undefined function pg_connect()
c:\xampp\php\php.ini "extension=php_pgsql.dll"
, Apache.
...
(6): [1] 2 3 4 5 6 »
Powered by ExBB FM 1.0 RC1. InvisionExBB