PHP
  Home arrow PHP arrow Page 5 - Executing Microsoft SQL Server Stored Proc...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Executing Microsoft SQL Server Stored Procedure from PHP on Linux
By: Jack Zhang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2003-10-20

    Table of Contents:
  • Executing Microsoft SQL Server Stored Procedure from PHP on Linux
  • Preparation
  • Installing the Apache Web Server
  • Installing the Apache Web Server, Cont'd
  • Installing FreeTDS
  • Modify the PHP Source Code
  • Modify the PHP Source Code, Cont'd
  • Executing MS SQL Server Procedures from PHP
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Executing Microsoft SQL Server Stored Procedure from PHP on Linux - Installing FreeTDS


    (Page 5 of 9 )

    From the /public folder, issue:

    cd FreeTDS-0.61.2

    This will change our working directory to FreeTDS.  According to the PHP documentation, if we want to use FreeTDS to connect to a MS SQL Server, we need to append --enable-msdblib to the configure command.  For detailed information, you can issue the following command:

    ./configure --help

    This is what I used for the installation of FreeTDS:

    ./configure  --prefix=/usr/local/freetds --sysconfdir=/usr/local/ freetds --with-tdsver=7.0 --enable-msdblib --enable-threadsafe --enable-sybase-compat

    Since there is less dependency on the operating system, it is easy to pass this step without any error.  Next, we compile the module tree, issue the following:

    make

    And install FreeTDS by issuing:

    make install

    After these 2 steps, you will find a new folder /usr/local/freetds, which contains the new files we’ve just installed.  Let’s test our installation, change directory to this folder, and issue:

    cd /usr/local/freetds

    Edit freetds.conf:

    gedit freetds.conf

    I have a windows box running MS SQL Server 2000 on it.  The machine name is home2k with IP address 192.168.0.212.  Append the following part to FreeTDS.conf, and save it:

    [home2k]
    host = 192.168.0.212
    port =1433
    tds version = 7.0

    Change to the bin folder under /usr/local/freetds,  and issue:

    tsql –S ‘home2k’ –U ‘sa’ –P ‘’

    If you see 1> coming out,  that means the connection to MS SQL Server is        established,  you can test further via sending an SQL statement to the SQL Server like the following screen, then exit using the tsql command.

    More PHP Articles
    More By Jack Zhang


     

    PHP ARTICLES

    - Making Usage Statistics in PHP
    - Installing PHP under Windows: Further Config...
    - File Version Management in PHP
    - Statistical View of Data in a Clustered Bar ...
    - Creating a Multi-File Upload Script in PHP
    - Executing Microsoft SQL Server Stored Proced...
    - Code 10x More Efficiently Using Data Access ...
    - A Few Tips for Speeding Up PHP Code
    - The Modular Web Page
    - Quick E-Commerce with PHP and PayPal
    - Regression Testing With JMeter
    - Building an Iterator with PHP
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek