Demo entry 6634959

test

   

Submitted by anonymous on Aug 15, 2017 at 12:12
Language: PHP. Code size: 487 Bytes.

<!DOCTYPE html>
<html>
<head>  
    <meta http-equiv="Content-Type" content="text/html"; charset="utf-8">   
</head>  
<body>
<p>用户名和密码</p>

<?php
try {
    $dbh = new PDO('mysql:host=localhost;dbname=test', 'evan','evan');
    foreach($dbh->query('SELECT * from user_list') as $row) {
    	echo "<p>";
        print_r($row);
      echo "</p>";
    }
    $dbh = null;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}
?>

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).