So I have a bit of a problem... A la I am posting on this forum. If you will bare with me for a short narrative I can explain the situation.

Currently a department in my school is involved in a Weather data collection project which they have asked me to take part in. The project involves writing data to an SQL database and then displaying this data via the web. The problem is the system that encompasses the weather data collector spits out .MDF files (MS SQL Server Style) and we only have PHP at our disposal. I am used to doing queries in PHP but only on a MY SQL database never directly to a .MDF file. Is there any way using PHP to directly access and manipulate a local .MDF file? Or does it need some sort of hosting like through MS SQL or SQL Server 2005?

Any help would be greatly appreciated. Thanks very much for taking the time to read through my problem.
Cheers.

Well, if you're using a Windows-based server, then Microsoft offers a free version of SQL server called SQL Server Express, available from their website.
You could also look into converting the file to a MySQL-compatible one. A quick google search revealed this, but it has some negative reviews.

I don't think there is any way to directly access the .mdf file with PHP...I think you need to attach it to a database server. You can download SQL Server Express for free:

2005 edition: http://www.microsoft.com/downloads/details.aspx?FamilyID=220549B5-0B07-4448-8848-DCC397514B41&displaylang=en

2008 edition: http://www.microsoft.com/express/Database/

You'll also want to download the tools (Sql Server Management Studio Express...also free) to make attaching the .mdf easy.

Hope that helps.
-Brian
At the Intersection of PHP and Microsoft

So I have a bit of a problem... A la I am posting on this forum. If you will bare with me for a short narrative I can explain the situation.

Currently a department in my school is involved in a Weather data collection project which they have asked me to take part in. The project involves writing data to an SQL database and then displaying this data via the web. The problem is the system that encompasses the weather data collector spits out .MDF files (MS SQL Server Style) and we only have PHP at our disposal. I am used to doing queries in PHP but only on a MY SQL database never directly to a .MDF file. Is there any way using PHP to directly access and manipulate a local .MDF file? Or does it need some sort of hosting like through MS SQL or SQL Server 2005?

Any help would be greatly appreciated. Thanks very much for taking the time to read through my problem.
Cheers.

I don't know what one of those look like inside, but I'd take a look if I were you and see what can be done. Maybe you can write a parser for it?

Also, php does have some support for ms databases, like access
http://phplens.com/adodb/supported.databases.html
Perhaps yours is kindred?

I don't know, I dislike anything Miicrosoft because it jams me into situations like this.
MS likes to reel you in with proprietary this and that. Self preservation i suppose...

Welcome to the Microsoft SQL Server Driver for PHP project!
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9

try that link just inform us if okay :-)

I attached the file. rename .txt to .exe okay?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.