cari

Rumah  >  Soal Jawab  >  teks badan

Saya tidak berjaya menjalankan kenyataan yang disediakan dalam PDO. Saya ingin meminta beberapa pakar untuk memberi saya nasihat.

<?php

$servername = "localhost";

$username = "root";

$password = "";

$dbname = "myDBPDO";

{
          cuba                                                 conn = new PDO("mysqli:host=$servername;dbname=$dbname;",$username,$password);

//Tetapkan mod ralat PDO kepada exception


$conn->serAttribute( PDO ::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);

                                                                                                                                                                                                                                                                                                                                  nama pertama,:nama keluarga,:e-mel)");


$stmt->bindParam(':firstname',$firstname);

$stmt->bindParam(':nama keluarga',$nama keluarga);


                                                                                                             $stmt->bindParam(':email',$email $email = "jhon@example.com";

  $); stmt->execute();

  $firstname = "Mary";


  $lastname = "Moe";

  $email = "mary                                                                                                                                                                                                                                                                                                                           le.com" ;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 $stmt->execute(); ";

" }catch(PDOException $e){

" "

$conn= null;

WW2548 hari yang lalu958

membalas semua(1)saya akan balas

  • 电动小老虎

    电动小老虎2017-11-23 23:05:09

    Siarkan kod ralat atau anda tidak akan dapat membacanya. .

    balas
    0
  • Batalbalas