Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/commonal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.4 by youi, Thu Nov 25 12:14:29 2004 UTC revision 1.5 by aga, Fri Nov 26 01:08:25 2004 UTC
# Line 2  Line 2 
2   *   *
3   * $Revision$   * $Revision$
4   * $Log$   * $Log$
5     * Revision 1.5  2004/11/26 01:08:25  aga
6     * ・addSlashes()作成.
7     *
8   * Revision 1.4  2004/11/25 12:14:29  youi   * Revision 1.4  2004/11/25 12:14:29  youi
9   * getUidの処理を定義した.   * getUidの処理を定義した.
10   *   *
# Line 32  Line 35 
35    
36  static MYSQL* mysql = NULL; //!< MySQLのハンドル  static MYSQL* mysql = NULL; //!< MySQLのハンドル
37    
38    /**
39     *
40     * phpのaddslashesと同じ。
41     *
42     * @param addslashesすべき文字列。NULL指定不可。
43     * @return addslashesされた文字列
44     */
45    string addSlashes( const char *str )
46    {
47            int len = strlen(str);
48            char *buf = new char[len*2+1];
49            int bufLen = mysql_real_escape_string( mysql, buf, str, len );
50            string s( buf, bufLen );
51            return s;
52    }
53    
54    
55  /**  /**
56   *   *
57   * データベースの初期化   * データベースの初期化

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26