$query = "select * from prekes"; $dbh= new PDO('odbc:SERVERIS', 'USERIS', 'PASSWORDAS'); $stmt = $dbh->prepare("$query"); $stmt->execute(); while ($row = $stmt->fetch()) { print_r($row); } unset($dbh); unset($stmt);