[PHP-users 15311]Re: [PHP-users15284]pg_atoiでエラーが出る

ohara takaaki ohr @ yoursys.org
2003年 5月 15日 (木) 19:31:12 JST


オハラです.
お世話になります.

Seto さんが書いてくださったようなスクリプトを
書いて実行しましたが,エラーは出ませんでした.

それから:
実際のテーブルと同じものを作成しました.
エラーが表示される際に SQL も表示している
のですが,その SQL をブラウザ上でコピーして
新しく作成したテーブルに php から挿入しましたが
エラーはありませんでした.

ということはブラウザで表示させている SQL と
実際にサーバに渡っている SQL は違うという
ことです(か?).

ログを見れないので・・・

# エラーは相変わらず出てます.

実際のエラー表示は以下のようなものです:

# クエリ(表示させている)
INSERT INTO table1( 
dltflg, ordercode, payment, corporationid, sendflg, usercode,
productcode, itemnumber,discountamount,orderdate,description,
creditcardinfo,comment,price1)
VALUES (
0,'gwI1052993187','bank','1111111',0,1,7,1,0,'1052993187','','','',
'20000')

# エラー
Warning: pg_exec() query failed:
ERROR: pg_atoi: error in "gwI1052993187": can't parse "gwI1052993187" in
/home/e-shopcity/public_html_e-shopcity.net/import_www_inc/common.inc on
line 238

同じ構成のテーブルに,上記クエリを php から INSERT 実行しても
エラーはありません.

# table1
 dltflg         | smallint |
 code           | integer  | not null default nextval('"table1_code_seq"'::text)
 ordercode      | text     |
 payment        | text     |
 corporationid  | text     |
 sendflg        | smallint |
 usercode       | bigint   |
 productcode    | bigint   |
 itemnumber     | integer  |
 discountamount | bigint   |
 orderdate      | text     |
 description    | text     |
 creditcardinfo | text     |
 comment        | text     |
 price1         | text     |
Unique keys: table1_code_key


-- 
ohara takaaki <ohr @ yoursys.org>



PHP-users メーリングリストの案内