LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 02-15-2007, 09:43 AM   #1
ckoniecny
Member
 
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:

Code:
<?php
include 'Configuration.php';
$conn=odbc_connect($DSN, $USERNAME, $PASSWORD)
        or die ("Error: ODBC_CONNECT()");
$query = "SELECT * FROM dbo.Course";
$rs=odbc_exec($conn,$query)
        or die ("Error: ODBC_EXEC()");
while (odbc_fetch_row($rs))
{
        $dept=odbc_result($rs,1);
        echo "$dept" . "<br>";
}
odbc_close($conn);
?>
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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:26 AM.

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