Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sqlLine = 'SELECT * FROM users WHERE username = "jasonnross"';
- function DBCommand ($sqlLine) {
- $sql_servername = "sched.rossware.net";
- $sql_username = "Jason";
- $sql_password = "4lGBIzjnwn0rPuOn";
- $sql_database = "JasonDev";
- $dsn = "'mysql:host='.$sql_servername.';dbname='.$sql_database';charset=utf8mb4'";
- try
- {
- $pdo = new PDO('mysql:host='.$sql_servername.';dbname='.$sql_database,$sql_username,$sql_password);
- // set the PDO Error mode to exception
- //echo "Connected successfully";
- }
- catch (PDOException $e)
- {
- echo "Connection failed: " .$e->getMessage();
- }
- // $stmt = $pdo->prepare('SELECT * FROM users WHERE username = "jasonnross"');
- $stmt = $pdo->prepare($sqlLine);
- $stmt->execute();
- if ($stmt->rowCount() > 0) {
- $result="yes";
- //echo "yes";
- } else {
- //echo "no";
- $result="no";
- }
- return $result;
- }
- DBCommand($sqlLine);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement