Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-15-2007, 09:43 AM   #1
Registered: Oct 2005
Posts: 162

Rep: Reputation: 30
PHP + unixODBC + MSSQL Question

I'm trying to display a table from a Microsoft SQL Database with PHP. I have another PHP script that runs and counts the rows in the table, so I know its connecting to the database correctly, but I cannot get the table to display. Heres the code I have so far:

include 'Configuration.php';
$conn=odbc_connect($DSN, $USERNAME, $PASSWORD)
        or die ("Error: ODBC_CONNECT()");
$query = "SELECT * FROM dbo.Course";
        or die ("Error: ODBC_EXEC()");
while (odbc_fetch_row($rs))
        echo "$dept" . "<br>";
If I run the script from the command line with "php5 phpscript.php" I get no errors.

Any ideas?

Last edited by ckoniecny; 02-15-2007 at 09:45 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
issue with unixodbc + freetds + php sugar2 *BSD 1 07-03-2006 08:45 PM
apache+php+unixODBC don't work Taxinha Linux - Software 0 05-17-2006 05:23 AM
Php + Mssql + Ldap lewus Linux - Software 4 01-27-2005 03:48 AM
RH9 + apache + php + mssql how to iel Linux - General 0 07-02-2004 05:25 AM
PHP and MSSQL BBPS Linux - Software 2 10-10-2003 11:36 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration