Skip to content

Instantly share code, notes, and snippets.

@mingtsay
Forked from linroex/gist:46b77db63e1b246d5703
Last active August 29, 2015 14:19
Show Gist options
  • Save mingtsay/375461d24ac4da33e49e to your computer and use it in GitHub Desktop.
Save mingtsay/375461d24ac4da33e49e to your computer and use it in GitHub Desktop.
<?php
$conn = new PDO("mysql:host=127.0.0.1;dbname=rfid;", "root", "");
$cursor = $conn->prepare("select * from :table ;");
//$cursor->execute(array(":table"=>"contrast"));
$cursor->bindValue(":table", "contrast");
$cursor->execute();
var_dump($cursor->fetch());
// var_dump($cursor);
// var_dump($conn->query("select * from contrast")->fetch());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment