bUTschy.de

  • Code

SIUD

Hier nur kurz mein SIUD mit PDO!

SELECT

$sql= 'SELECT `uid` FROM `userliste` WHERE `uid` = :uid';
$stmt = $db->prepare($sql);
$stmt->bindParam(':uid', $_POST['uid'], PDO::PARAM_INT);
$stmt->execute();

INSERT

$sql = 'INSERT INTO userliste(uname) VALUES (:uname)';
$stmt = $db->prepare($sql);
$stmt->bindParam(':uname', $_POST['uname'], PDO::PARAM_STR);      
$stmt->execute();

UPDATE

$sql = 'UPDATE `userliste` SET `uname` = :uname WHERE `uid` = :uid';
$stmt = $db->prepare($sql);                                 
$stmt->bindParam(':uname', $_POST['uname'], PDO::PARAM_STR);      
$stmt->bindParam(':uid', $_POST['uid'], PDO::PARAM_INT);  
$stmt->execute();

DELETE

$sql = 'DELETE FROM `userliste` WHERE `uid` = :uid';
$stmt = $db->prepare($sql);
$stmt->bindParam(':uid', $_POST['uid'], PDO::PARAM_INT);  
$stmt->execute();
  • 0 Kommentare
  • 6038 Klicks

Kommentare

Kommentar hinzufügen

🙂 😃 😀 😝 😇 😉 😋 😎 🤔 🙄 🙁 😕 😴 😧 😠 😢 😡