FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
framework/tests/async_mysql.php at master · fwling/framework · GitHub
fwling
framework
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
framework
/
tests
/
async_mysql.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (37 loc) · 1.07 KB
Breadcrumbs
framework
/
tests
/
async_mysql.php
Copy path
File metadata and controls
40 lines (37 loc) · 1.07 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
define
(
'
DEBUG
'
,
'
on
'
);
define
(
'
WEBPATH
'
,
realpath
(
__DIR__
.
'
/..
'
));
//包含框架入口文件
require
WEBPATH
.
'
/libs/lib_config.php
'
;
$
config
=
array
(
'
host
'
=>
'
10.10.2.38
'
,
'
user
'
=>
'
root
'
,
'
password
'
=>
'
root
'
,
'
database
'
=>
'
chelun
'
,
);
$
pool
=
new
Swoole
\
Async
\
MySQL
(
$
config
,
20
);
//$sql1 = "INSERT INTO `test`.`userinfo`
// (`id`, `name`, `passwd`, `regtime`, `lastlogin_ip`)
// VALUES ('0', 'womensss', 'world', '2015-06-15 13:50:34', '4')";
//$sql2 = "update userinfo set name='rango' where id = 16";
$
sql3
=
"
show tables
"
;
for
(
$
i
=
0
;
$
i
<
200
;
$
i
++)
{
$
pool
->
query
(
$
sql3
,
function
(
swoole_mysql
$
mysqli
,
$
result
)
use
(
$
i
)
{
if
(
$
result
===
true
)
{
echo
"
insert_id=
{
$
mysqli
->
insert_id
}
, _affected_rows=
{
$
mysqli
->
affected_rows
}\n"
;
}
elseif
(
$
result
===
false
)
{
echo
"
errno=
{
$
mysqli
->
errno
}
, error=
{
$
mysqli
->
error
}\n"
;
}
else
{
//var_dump($result);
}
echo
"
$
i
\t"
.
str_repeat
(
'
-
'
,
120
) .
"\n"
;
//usleep(10000);
});
}
Back
|
FazBrowse Home
|
New Git URL