Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F22777
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
stwalkerster
Jun 14 2017, 11:12 PM
2017-06-14 23:12:37 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
<?php
include
'includes/PdoDatabase.php'
;
$db
=
new
\Waca\PdoDatabase
(
'mysql:host=localhost;dbname=stwalkerster_scratch'
,
'stwalkerster'
,
'123'
,
array
(
// PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
));
$db2
=
new
\Waca\PdoDatabase
(
'mysql:host=localhost;dbname=stwalkerster_scratch'
,
'stwalkerster'
,
'123'
,
array
(
PDO
::
MYSQL_ATTR_INIT_COMMAND
=>
'SET NAMES utf8mb4'
,
));
$name
=
'小綿羊寶貝'
;
$db
->
exec
(
'TRUNCATE TABLE stwalkerster_scratch.request'
);
$db
->
exec
(
'TRUNCATE TABLE stwalkerster_scratch.request2'
);
$db
->
prepare
(
"INSERT INTO stwalkerster_scratch.request VALUES (:name);"
)->
execute
([
':name'
=>
$name
]);
$db
->
prepare
(
"INSERT INTO stwalkerster_scratch.request2 VALUES (:name);"
)->
execute
([
':name'
=>
$name
]);
$statement
=
$db
->
prepare
(
"SELECT name FROM stwalkerster_scratch.request;"
);
$statement
->
execute
();
$utf
=
$statement
->
fetchColumn
();
$statement
=
$db
->
prepare
(
"SELECT name FROM stwalkerster_scratch.request2;"
);
$statement
->
execute
();
$utfmb
=
$statement
->
fetchColumn
();
var_dump
(
$name
);
var_dump
(
bin2hex
(
$name
));
var_dump
(
$utf
);
var_dump
(
bin2hex
(
$utf
));
var_dump
(
$utfmb
);
var_dump
(
bin2hex
(
$utfmb
));
$db2
->
exec
(
'INSERT INTO acc_notifications.notification SELECT null, null, 2, name FROM stwalkerster_scratch.request'
);
$db2
->
exec
(
'INSERT INTO acc_notifications.notification SELECT null, null, 2, name FROM stwalkerster_scratch.request2'
);
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20885
Default Alt Text
(1 KB)
Attached To
Mode
P142 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment