Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
longxinH authored Oct 8, 2016
1 parent 132e619 commit 0c58993
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,32 @@ xhprof.output_dir = /tmp/xhprof
```

#新增
####pdo预处理
####pdo占位符转换
pdo预处理占位符将会转换成实际的参数,更好的掌握mysql执行消耗(只用做xhprof记录,不改变程序执行过程)
```php
$_sth = $db->prepare("SELECT * FROM user where userid = :id and username = :name");
$_sth->execute([':id' => '1', ':name' => 'admin']);
$data1 = $_sth->fetch();

$_sth = $db->prepare("SELECT * FROM user where userid = ?");
$_sth->execute([1]);
$data2 = $_sth->fetch();
```
#####xhprof记录数据
```
PDOStatement::execute#SELECT * FROM user where userid = 1 and username = admin
PDOStatement::execute#SELECT * FROM user where userid = 1
```

####curl地址记录
```php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.baidu.com");
$output = curl_exec($ch);
curl_close($ch);
```
#####xhprof记录数据
```
curl#http://www.baidu.com
```

0 comments on commit 0c58993

Please sign in to comment.