Jump to content

Brian Swan

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Brian Swan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This article has a table that lays out which .dll file to use depending on your set up: http://msdn.microsoft.com/en-us/library/cc296170.aspx -Brian
  2. If it's not too late, since you are running on Windows, you should use the Microsoft-supported sqlsrv extension. More detail here: http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx Hope that helps. -Brian
  3. Davez69gto- It's difficult to say what might be going on without seeing error details. Can you provide the detailed error returned by IIS and the Windows Application Event log entries for php-cgi.exe crashes? Thanks. -Brian
  4. You should also be using the VC9 build of the driver - that's what's recommended for FastCgi/IIS. -Brian
  5. Not silly/sloppy really....just something that you need a second set of eyes for. :-) Glad it's working now.
  6. Looks to me like you reset the $rs statement resource within one of your conditions. I've removed some of your code to try and show this. Your initial query defines the $rs statement resource, but then you reset it within the while loop. $rs = mssql_query($SQL, $link); while ($row = mssql_fetch_array($rs)) { ... if ($intAreas == 0) $AreasName = "All Areas"; else { $SQL = "SELECT * FROM Areas where AreasID = $intAreas"; // was EarnRateName; $rs = mssql_query($SQL, $link); while ($rws = mssql_fetch_array($rs)) { $AreaID = $rws['AreasID']; $AreasName = sprintf("%s", $rws['AreasName']); } } ... } Is that what you intended to do? Seems like that could be causing the problem. -Brian
  7. The most important thing in your php.ini file is that you have enabled the php_mssql extension. In the Extensions section you should see this line (uncommented): extension=php_mssql.dll After that, getting everything else set up will depend on whether you are on Linux/Apache or Windows/IIS. If you are on Windows, I'd suggest that you use the MSFT-supported extension (sqlsrv). More about that here: http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx. Also, if you are on Windows, using the Web Platform Installer can make set up and configuration easy: http://www.microsoft.com/web/downloads/platform.aspx Hope that helps. -Brian
  8. The error you are getting indicates that the php_mssql extension is not loaded. You can verify this by calling phpinfo() - my guess is that you won't see mssql as a loaded extension. Since you are running on Windows, I'd suggest that you use the MSFT-supported extension: php_sqlsrv. You can read about the differences between those two extensions here: http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx. You can download the sqlsrv extension here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80e44913-24b4-4113-8807-caae6cf2ca05. Regardless of which driver you use, you need to put the extension file in your PHP extension directory, add the appropriate entry to your php.ini file, and restart your web server. Hope that helps. -Brian
  9. It's not quite clear to me what you are trying to do. Can you post some code that shows what you are doing? That would help in figuring out if there is a better way of doing it. Thanks. -Brian
  10. I don't know if the port number is the problem. The error you are showing in your first post tells me that the correct version of ODBC is not installed on the same machine that is running PHP. Have you installed the latest ODBC on that machine? If the port number is the issue, try this: $serverName = "Zeus,1001"; The way you were doing it, it looked like Zeus was an instance name (not sure that's your set up). More info here: http://msdn.microsoft.com/en-us/library/cc761422(SQL.90).aspx -Brian
  11. I think you have an old version of the ODBC driver installed (the SQLSRV extension needs a newer version). You can download x86 or x86 versions from this page in the SQLSRV documentation: http://msdn.microsoft.com/en-us/library/cc296170(SQL.90).aspx (Look where it says Microsoft SQL Server 2008 R2 Native Client.)
  12. Are you using IIS or Apache? If you are using IIS, it is probably configured so that PHP handles only pages that end with the .php extension. If your page above is named someName.html, IIS won't know that PHP should handle the page. Not sure if Apache works similarly. My suggestion: try naming your page with .php extension and see what happens. Hope that helps. -Brian
  13. Give this a try: SELECT * FROM news WHERE show = 'true' AND YEAR(date) = 2011 AND MONTH(date) = 1 ORDER BY date desc, id2 desc Hope that helps. -Brian
  14. If you are using IIS 7, you should check out the PHP Manager. You can download it here: http://phpmanager.codeplex.com/releases/view/59970. This video will show you what you can do with it and how to use it: http://blogs.msdn.com/b/brian_swan/archive/2010/12/16/video-tour-of-php-manager-for-iis.aspx. Hope that helps. -Brian
  15. This might work, but only if you are using the sqlsrv extension for connecting to SQL Server: You could sign up for the free trial of SQL Azure (Microsoft's RDBMS in the cloud) and test against it. If you are using the php_mssql extension to connect, I'm not sure this is an option. In case you are, by chance, using the php_sqlsrv extension, this blog post will get you started with SQL Azure: http://blogs.msdn.com/b/brian_swan/archive/2010/02/12/getting-started-with-php-and-sql-azure.aspx -Brian
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.