Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

bat86 Jan 30th, 2015 (edited) 315 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2. $host="localhost";
  3. $base="TEST_DAILYSECURITYDB";
  4. $login="root";
  5. $passe="";
  6.  
  7. $pdo= new PDO("mysql: $host; port=3306; dbname=$base",$login,$passe);
  8. $pdo->setattribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  9.  
  10. /* INSERTION DANS LA BDD
  11. $stmt=$pdo->prepare("INSERT INTO TEST_DAILYSECURITY VALUES (default,:login, :password)");
  12.  
  13. $stmt->bindParam(':login', $nom);
  14. $stmt->bindParam(':password', $pass);
  15.  
  16. $nom="admin                                               x";
  17. $pass="testpdo";
  18.  
  19. $stmt->execute();
  20. echo "done";
  21. */
  22.  
  23.  
  24. // SELECT
  25.  
  26. $query = $pdo->prepare("select login FROM test_dailysecurity");
  27. $query->execute();
  28.  
  29. for($i=0; $row = $query->fetch(); $i++){
  30.   echo $i." --".$row['login']."--<br/>";
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top