久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      PHP中如何使用PDO修改數(shù)據(jù)?

      PHP中如何使用PDO修改數(shù)據(jù)?

      PHP中如何使用PDO修改數(shù)據(jù)?

      首先進行連接數(shù)據(jù)庫,將PDO對象進行實例化;

      $dbms = 'mysql'; $user = 'root'; $pwd = '12345678'; $dbName = 'ceshi'; $host = 'localhost'; $charset = 'utf8'; $dsn = "$dbms:host=$host;dbname=$dbName;charset=$charset"; try { $pdo = new PDO( $dsn, $user, $pwd ); } catch ( Exception $e ) { echo $e->getMessage(); }

      然后編寫一個SQL語句模板;接著使用方法“prepare()”方法,將SQL語句進行預處理;

      $sql = "select * from dunling_chat where id=? "; //準備sql模板 $stmt = $pdo->prepare( $sql );

      最后進行參數(shù)綁定并執(zhí)行SQL即可。

      $id = '1'; //綁定參數(shù) $stmt->bindValue( 1, $id ); //執(zhí)行預處理語句 $stmt->execute();

      推薦教程:《PHP教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號