Advertisement
Sparkster

Untitled

Jul 22nd, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.      
  3.     $pdo = new PDO("mysql:host=localhost;dbname=fantapc", 'root', '');
  4.  
  5.  
  6.     if(isset($_POST['addcard'])) {
  7.         $cardname = $_POST['card_input'];
  8.         $rarity = $_POST['rarity_input'];
  9.         $image = $_POST['img_input']
  10.  
  11.         $query = $pdo->prepare("INSERT INTO cards (name,rarity,img) VALUES (:name,:rarity,:img)");
  12.         $query->bindValue(":name", $cardname, PDO::PARAM_STR);
  13.         $query->bindValue(":rarity", $rarity, PDO::PARAM_STR);
  14.         $query->bindValue(":img", $image, PDO::PARAM_STR);
  15.         $query->execute();
  16.     }
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement