• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[HELP]WO_5SQL Connect failed ONLY IN REMOTE API

Newbie Spellweaver
Joined
Apr 3, 2013
Messages
15
Reaction score
0
Hi,
I'm trying to use a remote api to upload my files but I can not connect to mysql..already searched the forum and found nothing about..
I can use the normally wzadmin tool remotely, but not this


here the api files config

webconfig
PHP:
<?xml version="1.0"?><!--     Note: As an alternative to hand editing this file you can use the     web admin tool to configure settings for your application. Use    the Website->Asp.Net Configuration option in Visual Studio.    A full list of settings and comments can be found in     machine.config.comments usually located in     \Windows\Microsoft.Net\Framework\v2.x\Config --><configuration>    <!-- application specific settings -->    <appSettings>        <add key="WO_Region" value="EN"/>    </appSettings>  <connectionStrings >    <add name="dbConnectionString" connectionString="Server=167.114.4.227;Database=WarZ;User ID=wz_api_user;Password=xxxx;Trusted_Connection=True;" providerName="System.Data.SqlClient"/>  </connectionStrings>    <system.web>        <httpRuntime enableVersionHeader="false" />        <!--             Set compilation debug="true" to insert debugging             symbols into the compiled page. Because this             affects performance, set this value to true only             during development.        -->        <compilation debug="false">            <assemblies>                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>        <!--            The <authentication> section enables configuration             of the security authentication mode used by             ASP.NET to identify an incoming user.         -->        <!--<authentication mode="None"/>-->        <!--            The <customErrors> section enables configuration             of what to do if/when an unhandled error occurs             during the execution of a request. Specifically,             it enables developers to configure html error pages             to be displayed in place of a error stack trace.
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">            <error statusCode="403" redirect="NoAccess.htm" />            <error statusCode="404" redirect="FileNotFound.htm" />        </customErrors>        -->    </system.web></configuration>

db
PHP:
<?php    $db_apikey = "mydbkeybro";    function db_connect()    {        $db_user   = "wz_api_user";        $db_pass   = "xxxxx";        $db_dbname = "WarZ";
        $db_serverName     = "WarZ";        $db_connectionInfo = array(            "UID" => $db_user,            "PWD" => $db_pass,            "Database" => $db_dbname,            "CharacterSet" => "UTF-8"            //"ReturnDatesAsStrings" => true            );        $conn = sqlsrv_connect($db_serverName, $db_connectionInfo);
        if(! $conn)        {            //echo "Connection could not be established.\n";            die( print_r( sqlsrv_errors(), true));            exit();        }
        return $conn;    }
    function db_exec($conn, $tsql, $params)    {        $stmt  = sqlsrv_query($conn, $tsql, $params);        if(! $stmt)        {            echo "exec failed.\n";            die( print_r( sqlsrv_errors(), true));        }
        $member = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC);        return $member;    }
    $conn = db_connect();?>
 
Back
Top