Reply to Re: Postgres Insert return codes

Your name:

Reply:


Posted by Rik on 05/18/06 23:19

Syl wrote:
> Can someone tell me why if the insert fails on the 1st insert, then
> all the other inserts also return a FAILURE return code :


Do you mean that after performing:

> $delegateres = pg_insert($conn, 'delegate', $delegatecontent);

This also returns also false, while it should be true (you verified it
worked)?
> $meetingres = pg_insert($conn, 'meetings', $meetingcontent);

I'm not aware on anthything wrong with the syntax (never used pg_insert()
though), but why not:

if (pg_insert($conn, 'delegate', $delegatecontent)) {
// echo "success del";
} else {
echo "<b>INSERT Failed!
}

BTW: User comment on php.net:
ANDYCHR17 ***********
05-May-2006 11:50
- Function was returning false until I passed the PGSQL_DML_EXEC option.

So, try pg_insert($conn, 'delegate', $delegatecontent, PGSQL_DML_EXEC);

Grtz,
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация