Odbc Error 500
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers how to solve 500 internal server error problem or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x 500 - internal server error. iis 8 Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it there is a problem with the resource you are looking for, and it cannot be displayed. only takes a minute: Sign up ODBC INSERT/UPDATE statements trigger internal server error (500) up vote 1 down vote favorite I am currently building a PHP site, which has to connect to a data source via an ODBC connection. The
Bter
data source is not common and the driver was supplied by the customer (and no, they don't know how it all works :) ). I was able to successfully connect to a test data source and SELECT statements work just fine. For example, this works: $resource = odbc_prepare($connection,'SELECT * FROM [TABLE] WHERE EMAIL=?'); $success = odbc_execute($res,array('some@email'); I am able to read any information from the database. However, INSETR/UPDATE statements don't seem to work: $resource = odbc_prepare($connection,'UPDATE [TABLE] SET EMAIL=? WHERE ID=?'); $success = odbc_execute($res,array('some@email',1); The above statement returns an internal server error. It only says, that the error is linked to the odbc_execute() command. I checked the Apache error logs and there was no information about what could cause the error. I checked the folder, where the test database is stored (since the database is just a bunch of files without extensions and .IDX files. My guess is, that the .IDX files are the index files for the actual DB files) and none of them are readonly. Also, I gave anonymous users permission to modify the DB folder contents (I was desperate), no effect. I don't think there is an error in the SQL statement, because I tried adding a syntax error and I got back a descriptive error about what is wrong. I can not use odbc_error($connection); since I get an internal server error before I get to that line. Any suggestions what could be wrong? I would be grateful for every hint in the right direction :) php odbc share|improve this question asked May 9 '15 at 7:14 itd 1,38221624 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted You need to look at the ODBC connection. Depending on your version of Windows on that server, you want to open Data Sources (ODBC). Select the alias you are using. Right Click and select Configure / Edit (there may be a but
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like http://stackoverflow.com/questions/30137157/odbc-insert-update-statements-trigger-internal-server-error-500 you, helping each other. Join them; it only takes a minute: Sign up Receiving HTTP 500 Internal Server Error when doing a odbc_result call in my php application up vote 1 down vote favorite I have reviewed a number of threads regarding the causes of the HTTP 500 when using php through fast-cgi, but none of them http://stackoverflow.com/questions/20553699/receiving-http-500-internal-server-error-when-doing-a-odbc-result-call-in-my-php (that I could find) were related to the odbc_result call, and is intermittent based either on the size (likely) or content (seems unlikely) of the data being extracted from the result set. My php code looks like the following: $sql = "select [errorSummary],[messageLog],[scanType],[runName] FROM [SDITriage].[dbo].[SourceJobs] Where id = $sourceJobID"; Debug("Import job scan message query = $sql"); # perform the query $result = odbc_exec($odbcConn, $sql); if (! $result) { # get the odbc error message $returnData["error"] = "Unable to query the import job scan message data from the triage database: " . odbc_errormsg($odbcConn); $returnData["rc"] = FALSE; Debug("GetScanMessageData exit. (2) " . print_r($return,TRUE)); $nestingLevel--; return($returnData); } # fetch import job data $fetchResult = odbc_fetch_row($result); Debug("Fetch Result = $fetchResult"); $returnData["errorSummary"] = ($fetchResult ? odbc_result($result,1) : ""); $returnData["messageLog"] = ($fetchResult ? odbc_result($result,2) : ""); $returnData["type"] = ($fetchResult ? odbc_result($result,3) : ""); $returnData["name"] = ($fetchResult ? odbc_result($result,4) : ""); On most invocations of the query above, I get the http 500 error and it is triggered on the odbc_result($result,2) line. There is no inf
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 19:00:34 GMT by s_ac4 (squid/3.5.20)