daily pastebin goal
50%
SHARE
TWEET

PDO DB sor kiiratás

OneTallor Jun 5th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try
  2. {
  3.     $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  4.     $username = "uname"; //DB USERNAME
  5.     $password = "pword"; //DB PASSWORD
  6.  
  7.     $datab = new PDO('mysql:host=127.0.0.1;dbname=dbname', $username, $password, $pdo_options);
  8. }
  9. catch (Exception $e)
  10. {
  11.         echo "hiba: ".$e->getMessage();
  12.         die();
  13. }
  14.  
  15. // Index sor keresése
  16. $visitsI = $datab->prepare("SELECT * FROM views WHERE page ='index'");
  17. $visitsI->execute();
  18. $counterI = $visitsI->fetch(PDO::FETCH_ASSOC);
  19.  
  20. // 'num' oszlop kiiratása index sorból
  21. kiiratás: $counterI['num']
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