Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 06-29-2011, 12:31 AM   #1
LQ Newbie
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
Lightbulb odbc (php output not displaying in web browser,but it displaying in terminal)

Dear friends

I am install and conf freeTDS in our Redhat 6 server for Accesing MSSQL Database server.Our MSSQL Database server connection getting from redhat.I am writting php code for displaying data from mssql data base,The output will displaying in terminal.But the same php page running in browser output not getting.What is the reson any conf: issues ,Anybody can help me......

$connect = odbc_connect("MSSQLTest", "u_name", "pwd");
$query = "SELECT * FROM users";
$result = odbc_exec($connect, $query);

# fetch the data from the database
while(odbc_fetch_row($result)) {
$field1 = odbc_result($result, 1);
$field2 = odbc_result($result, 2);
print("$field1 $field2\n");


Last edited by manu@vssc; 06-29-2011 at 12:43 AM.
Old 06-29-2011, 01:33 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Two suggestions:

1. Add some "printf's" before your query, during the loop, and after the loop finishes.
This will verify the code is being executed and the "printf" goes to the HTML page.

Who knows - it might also show you that the loop is empty - that no data was read

2. Check the status of your "connect". Print the mysql error status if the connect fails.

'Hope that helps .. PSM
1 members found this post helpful.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help to prevent displaying image on web browser chobong Linux - Newbie 9 09-13-2010 09:03 PM
Problem displaying images in browser Tank Jr Mandriva 1 09-26-2007 12:22 PM
Displaying a message on terminal roland_andrey Linux - General 4 01-10-2005 04:53 PM
Displaying GML in Konqueror browser TechiePerson Linux - Software 0 12-12-2004 11:40 AM
displaying terminal output on root window? mporter Slackware 2 03-21-2003 01:58 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 01:16 AM.

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
Open Source Consulting | Domain Registration