Example #1
0
 private void OnGUI()
 {
     if (GUI.Button(new Rect(0, 0, 100, 100), "Send"))
     {
         string      strQuery = "SELECT * FROM ncsrpg";
         eResultMode mode     = eResultMode.SELECT;
         StartCoroutine(GetSqlResult(mode, strQuery));
     }
 }
Example #2
0
    IEnumerator GetSqlResult(eResultMode mode, string sql)
    {
        WWWForm form = new WWWForm();

        form.AddField("servername", m_strServerAddr);
        form.AddField("database", m_strDataBase);
        form.AddField("mode", string.Format("{0}", (int)mode));
        form.AddField("sql", sql);
        Debug.Log(string.Format("servername:{0} database:{1} sql:{2}", m_strServerAddr, m_strDataBase, sql));

        WWW webRequest = new WWW(string.Format("http://{0}/sql_query_result.php"
                                               , m_strServerAddr), form);

        yield return(webRequest);

        if (webRequest.isDone)
        {
            Debug.Log("Find:" + webRequest.text);
        }
        else
        {
            Debug.LogError("Filed : " + webRequest.error);
        }
    }