找回密碼
 註冊
搜索
查看: 3388|回復: 0

PDO Select

[複製鏈接]
發表於 2013-4-2 16:18:35 | 顯示全部樓層 |閱讀模式
取單筆值
  1. $dbh = new PDO($CHUconn, $CHUid, $CHUpw);
  2. $query = 'SELECT NEWID()';
  3. $stmt = $dbh->prepare($query);
  4. $stmt->execute();
  5. $result = $stmt->fetch();
  6. echo $result[0];
複製代碼
Reference: http://stackoverflow.com/questio ... eturning-single-row
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-12-21 21:06 , Processed in 0.018868 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表