You are here: How to stop PEAR DB reporting errors? « PHP SQL « IT news, forums, messages
How to stop PEAR DB reporting errors?

Posted by no on 06/21/05 03:14

Hi

I have a very simple script that has to either INSERT a record if one
doesn't exist or UPDATE one if it does (the table has a unique index
on 2 fields). So, i am using PEAR DB and i was hoping to do an INSERT,
then trap any resulting error and if it creates an error (assume it is
caused by a duplicate) and do the UPDATE.

My problem is, i always get an error ("DB Error: already exists"),
even if i preceed the $db->query() with @ ... or i switch
error_reporting(0). It never allows me to do my own error handling.

How should i be doing this? Am i on the right track? :-s

Many thanks
Chris R.

 

Navigation:

[Reply to this 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

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