[HELP]WO_5SQL Connect failed ONLY IN REMOTE API

Results 1 to 1 of 1
  1. #1
    Apprentice Matheus M is offline
    MemberRank
    Apr 2013 Join Date
    15Posts

    [HELP]WO_5SQL Connect failed ONLY IN REMOTE API

    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 Code:
    <?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 Code:
    <?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_rsqlsrv_errors(), true));        }
            
    $member sqlsrv_fetch_array($stmtSQLSRV_FETCH_ASSOC);        return $member;    }
        
    $conn db_connect();?>




Advertisement