Sponsored Content
Top Forums Shell Programming and Scripting Getting junk data from MS SQL Server 2008 R2 using PHP 5.3.16 Post 302881981 by rangarasan on Friday 3rd of January 2014 10:25:32 AM
Old 01-03-2014
Getting junk data from MS SQL Server 2008 R2 using PHP 5.3.16

Hey!!!

I am just trying to connect MS SQL Server 2008 R2 from PHP Version 5.3.16 using IIS 7.0.

I am able to connect my MS Sql Server but I am getting junk data eventhough there is a valid data exists. I don't know what is the reason for that. Below is my code snippet.

Code:
$conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$db;", 'xxxxx', 'xxxxx');
    $rs = odbc_exec($conn,$strSQL);
    if (!$rs){
        exit("Error in SQL");
    }
 
    $index = 1;
    while (odbc_fetch_row ($rs)){
       echo $index . "," . odbc_result($rs, 1) . "," . odbc_result($rs, 2);
       $index++;
    }

Below is my output when I execute the above code:

Code:
1,ćuser,xuY
2,ćuser,xuY

Can you please help me on this?

Thanks in advance,

Cheers,
-R
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Shell Script to clense junk data file

Hello Shell Gurus i need help in solving this puzzle. We have a junk data file that needs to be fed into the database. Need to clense the data file thru shell script. I am not a expert and so need help with Here is what i need to do on the input file -Step -1 Replace all pipes ‘|' within... (0 Replies)
Discussion started by: rimss
0 Replies

2. Shell Programming and Scripting

Clense Junk Data File - Using Shell or awk or sed

Hello Shell Gurus i need help in solving this puzzle. We have a junk data file that needs to be fed into the database. Need to clense the data file thru shell script. I am not a expert and so need help with Here is what i need to do on the input file -Step -1 Replace all pipes ‘|' within... (1 Reply)
Discussion started by: rimss
1 Replies

3. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

4. Red Hat

microsoft Server 2008 Active authentication to a linux server

Hi, Please could someone advise I'm trying to use winscp from a Window server 2008 R2, but i need to add the authentication key to access the linux rh 5.4 servers ? What is the best way of approaching this ? If there are any web links that could help me do this, that would be good. ... (1 Reply)
Discussion started by: venhart
1 Replies

5. Shell Programming and Scripting

Check Junk character in sql file

Hello, I have two .sql files which I transferred from Windows to Unix (Linux Enterprise Linux Server release 5.3).I want to ensure that these two files have no junk characters in them.How do I do it in the simplest possible way? Many thanks DJ (1 Reply)
Discussion started by: Digjoy83
1 Replies

6. UNIX for Dummies Questions & Answers

Remove untagged and junk data from an XML

Hi All , I have seen a lot of code samples which suggest how to remove the junk data from and XML , I need a code in unix which removes the junk characters as well as the valid characters those are not in XML tags , for example my XML is as follows : <?xml version="1.0"... (6 Replies)
Discussion started by: IshuGupta
6 Replies

7. Shell Programming and Scripting

Junk character appearing after downloading the file from windows server

Hello, Im downloading the file from windows server through FTP, the downloaded file is containing some junk character at very start of the file as below and causing my whole script is to fail, how to download without junk or how to remove these before processing it? ▒▒"nmdbfnmdsfsdf" ... (19 Replies)
Discussion started by: Riverstone
19 Replies

8. Shell Programming and Scripting

Shell to SQL for data

Input: Table: TAB1 CHILD PARENT SS MID MNM VNM RULE FLG 1 ? S1 ? ? V1 rule004 I 2 1 S1 ? ? V1 0 Z 3 1 S1 ? ? V1 1 Z 4 2 S1 ? ? V2 rule001 N 5 4 S1 ? ? V2 -999999999 to 20000 OR Missing Z 6 4 S1 ? ? V2 20000.000001 to 999999999 Z ... (3 Replies)
Discussion started by: gksenthilkumar
3 Replies
Net::Server::Proto::TCP(3)				User Contributed Perl Documentation				Net::Server::Proto::TCP(3)

NAME
Net::Server::Proto::TCP - Net::Server TCP protocol. SYNOPSIS
See Net::Server::Proto. DESCRIPTION
Protocol module for Net::Server. This module implements the SOCK_STREAM socket type under INET (also known as TCP). See Net::Server::Proto. PARAMETERS
There are no additional parameters that can be specified. See Net::Server for more information on reading arguments. INTERNAL METHODS
"object" Returns an object with parameters suitable for eventual creation of a IO::Socket::INET object listining on UDP. "log_connect" Called before binding the socket to provide useful information to the logs. "connect" Called when actually binding the port. Handles default parameters before calling parent method. "reconnect" Called instead of connect method during a server hup. "accept" Override of the parent class to make sure necessary parameters are passed down to client sockets. "poll_cb" Allow for psgi compatible interface during HTTP server. "read_until" Takes a regular expression, reads from the socket until the regular expression is matched. "hup_string" Returns a unique identifier that can be passed to the re-exec'ed process during HUP. "show" Basic dumper of properties stored in the glob. "AUTOLOAD" Handle accessor methods. LICENCE
Distributed under the same terms as Net::Server perl v5.18.2 2013-01-09 Net::Server::Proto::TCP(3)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy