?
Solved

Configure Seagull to use MSSQL

Posted on 2008-01-30
6
Medium Priority
?
582 Views
Last Modified: 2013-12-13
Hello, I'm using the Seagull PHP Framework for one website and it works great....on MySQL....the problem is, I need it work on Microsoft SQL Server.

Seagull uses PEAR DB, which has a native MSSQL driver as well as an ODBC driver.  Either one would be perfectly acceptable.

I've scoured the Internet and cannot figure out how to do it.

Changing my current setup over to MSSQL would be fine, but making a fresh install into MSSQL would be even better.

Thanks for your help...I only wish there wasn't a 500point max on this one :(
0
Comment
Question by:dban00b
  • 3
  • 2
6 Comments
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 20783865
This should be extremely straightforward. In your config file you will currently have a DB entry that lists 'mysql' in the type property - just change it to 'mssql'.

Failing that, you can explicitly connect to a DB like this:

$dsn = 'mssql://username:password@localhost/myDB';
$dbhExt = & SGL_DB::singleton($dsn);
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 20784010
Seagull uses PEAR DB, which has a native MSSQL driver as well as an ODBC driver.  Either one would be perfectly acceptable.


>> did you try and configured ..? got an error or just find the possibility?
0
 
LVL 1

Author Comment

by:dban00b
ID: 20788467
$dsn = 'mssql://username:password@localhost/myDB';
$dbhExt = & SGL_DB::singleton($dsn);

Where would I put this code? Which file(s)?

----------------------------------------------------------------------------

>> did you try and configured ..? got an error or just find the possibility?
Once I learned seagull uses PEAR DB, I went to PEAR's site and found that out.  So I'm pretty sure PEAR can do it, even though Seagull only has choices/files for mysql, postgres, and oci
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 20789206
Wherever your config file is - usually in seagull/var/<your-hostname>_<port-number>.conf.php
The config file won't have a whole DSN in it, but it will have separate parts for each component of it.
The whole point of PEAR DB is that changing 'mysql' to 'mssql' on connection should be the only thing you need to do.

Alternatively, you can re-run the installer (setup.php).
0
 
LVL 25

Expert Comment

by:Marcus Bointon
ID: 20871896
Did you get this working?
0
 
LVL 1

Accepted Solution

by:
dban00b earned 0 total points
ID: 20887794
Changing the config file didn't work (visiting the site produces "Cannot connect to DB")
Changing the $dsn variable didn't work (same error)

I have written a test page from scratch that can connect to the MSSQL database using PearDB.  So I know PHP5 and the PearDB pakcage are working correctly, as well as knowing that my SQL Server install is accepting connections on port 1433.

But alas, I'm still stuck on my original question, how to get Seagull to do it.  There are so many files, and everything is built across them, I haven't been able to locate the what and where that needs changed--let alone what those changes are going to be.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question