notorm icon indicating copy to clipboard operation
notorm copied to clipboard

Direct query

Open likedo opened this issue 10 years ago • 1 comments

Hello , sorry for my English . I wanted to know how do I write a query "by hand " . I would need to run this query : " SHOW TABLES " to read the list of database tables . Thanks for your help.

likedo avatar Jul 07 '15 10:07 likedo

Not a NotORM question, you can do that with PDO.

$db = new PDO('mysql:dbname=test;host=localhost', 'test', 'test');
$result = $db->query("show tables");
while ($row = $result->fetch()) {
    var_dump($row);
}

Langmans avatar Aug 29 '15 15:08 Langmans