Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, I'm trying to start working with the PDO object class for database use. I'm using MSSQL as my database.
The problem is when I use the SQL wildcard (*), it returns zero rows as results. However, when I specify a specific column, it outputs results just fine. What could I be missing? Code below:Code: Select all
<?php
try {
$dbh = new PDO('mssql:host=localhost;dbname=test_db', 'db_name', 'notarealpassword');
foreach ($dbh->query('SELECT * FROM test_table') as $row) {
print_r($row);
}
$dbh = null;
}
catch (PDOException $e) {
die('<span style="font-style: bold;">Error:</span> '.$e->getMessage());
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]