Jump to content

mkswanson

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by mkswanson

  1. I'm having problems with a simple mssql_connect to a remote server. $ngLink = mssql_connect($ngServer, $ngLogin, $ngPassword); if ( !$ngLink ) { die('Connection to database failed!'); } If I point the server to a local instance of SQL 2008, the connection is successful. If I point the server to a remote instance of SQL 2008, I get a connection failed message. Both the remote and local PCs are Win2K8 with SQL 2008 standard. I have successfully connected to the remote instance using SQL management studio from my web server, so this does not appear to be a problem with the firewall or blocking based on IP. I have also successfully connected to the remote SQL instance from my dev box, through management studio and PhpStorm. I have enabled TCP/IP and named pipes in SQL configuration. I have tried capturing the last PHP error, which is a generic connection failed error, as well as the last MSSQL error, which is null since a connection isn't actually happening so MSSQL isn't generating an error. I have reviewed event viewer logs as well as other logs, and not been able to find anything that points me to the right direction. Any suggestions on where I can begin to look to troubleshoot?
  2. I'm having problems with enabling the sort functions of jqgrid. I think I've narrowed the problem down to the way MSSQL is returning the data to the SQL query. In an effort to troubleshoot, I've drastically simplified the problem. The query I'm using is below. SELECT * FROM dbo.test ORDER BY locationName When I run the query directly in MSSQL Management Studio, the top 5 ID entries are 132, 1309, 1295, 1281, 1267. When I run the corresponding code in PHP, the top 5 ID entries are 1266, 1267, 1268, 1269, 1270 - it seems to be ignoring my order by clause. Is there something I need to do to force it to honor the ORDER BY locationName? $kpiQuery = "SELECT * FROM dbo.test ORDER BY locationName"; $result = mssql_query($kpiQuery); while($kpiRow = mssql_fetch_array($kpiResult)) { echo $kpiRow[plDataID]."<br>"; }
  3. Thanks for the start here. I've been trying to use get_file_contents to read in the file, but it seems to be dropping any of the characters I'm trying to use to parse this. Is this because I should be using a different command? Sorry if this is a dumb question - I don't have a lot of experience working with files since most of my work like this has been directly with a database and not an intermediate flat file. Thanks for the assistance!
  4. I have a file that is uploaded by the user that has a series of rows of data in an html table. The columns are always a constant, but the number of rows in the file can change. These rows of the html table are the only information in the file when I am processing it. I need to either convert the file to a CSV file or write the values to a CSV list so that I can then insert them into a database. Any suggestions would be wonderful...I've spent the last three hours spinning my wheels. Here is an example of one row of data from the file: <tr><td bgcolor=#dddddd class=dataFT >5 (Excellent)</td><td bgcolor=#dddddd class=dataFT >5 (Excellent)</td><td bgcolor=#dddddd class=dataFT >5 (Excellent)</td><td bgcolor=#dddddd class=dataFT > </td><td bgcolor=#dddddd class=dataFT > </td><td bgcolor=#dddddd class=dataFT >DATA</td><td bgcolor=#dddddd class=dataFT >1015020</td><td bgcolor=#dddddd class=dataFT >155498322</td><td bgcolor=#dddddd class=dataFT >DATA</td><td bgcolor=#dddddd class=dataFT >4731751</td><td bgcolor=#dddddd class=dataFT >2011-09-25 11:18:33 (-5:00)</td><td bgcolor=#dddddd class=dataFT >2011-09-25 12:16:50 (-5:00)</td><td bgcolor=#dddddd class=dataFT >0:58:17</td><td bgcolor=#dddddd class=dataFT >0:58:16</td><td bgcolor=#dddddd class=dataFT >DATA</td><td bgcolor=#dddddd class=dataFT >DATA</td><td bgcolor=#dddddd class=dataFT >DATA</td><td bgcolor=#dddddd class=dataFT >Resolved</td></tr>
×
×
  • 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.