Skip to content

Instantly share code, notes, and snippets.

@malikkurosaki
Created August 7, 2018 07:55
Show Gist options
  • Save malikkurosaki/db804ab12116d19a8f5f178fb6b48367 to your computer and use it in GitHub Desktop.
Save malikkurosaki/db804ab12116d19a8f5f178fb6b48367 to your computer and use it in GitHub Desktop.
sqlite3 return collumn name
<?php
$db = new SQLite3("mydb.db");
$perintah = <<<AOD
SELECT name FROM sqlite_master
AOD;
$lakukan = $db->query($perintah);
while($data = $lakukan->fetchArray()){
//echo $data["name"]." | ";
}
$perintah2 = <<<AOD
PRAGMA table_info(biodata)
AOD;
$lakukan2 = $db->query($perintah2);
while($data2 = $lakukan2->fetchArray()){
echo $data2["name"]." | ";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment