Browse CVS Repository
Diff of /xoonips/AL/commonal.cc
Parent Directory
| Revision Log
| Revision Graph
| Patch
| 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 |
* |
* |
| 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 |
|
|
|