thomasantony / codeigniter-azure

A Codeigniter library that wraps over Microsoft's phpAzure library ( + query caching using CI's caching library )
8 stars 0 forks source link

How to? #1

Open johnblythe opened 11 years ago

johnblythe commented 11 years ago

hey there,

i've been trying to get this and/or the php-azure-sdk to help me connect to a client's sql db on azure and i've so far had zero luck.

i really don't know at this point what i'm doing wrong. i also don't know how much dependency my task has on the php sdk vs. this library. do they work synergistically? independently?

if this isn't the right format for asking these kinds of questions then please feel free to reply at johnblythe@gmail.com

omkarkhair commented 11 years ago

Facing similar issue. Here's how my model looks. Can anyone tell me if I am doing it right?

I keep getting a Server Error.


class model_Azure extends CI_Model {

    function __construct()
    {
        parent::__construct();
        $this->load->database();
        $this->load->library('session');
        $this->load->library('azure');
    }

    function test(){
        $conn = "DefaultEndpointsProtocol=[http|https];AccountName=[myaccount];AccountKey=[accountKey]"
        $tableRestProxy = ServicesBuilder->getInstance->createTableService($conn);
        try {
            // Create table.
            $tableRestProxy->createTable("mytable");
        } catch(ServiceException $e){
            $code = $e->getCode();
            $error_message = $e->getMessage();
            echo $code.": ".$error_message."<br />";
        }
    }

}