K
K
Kozlov2019-12-02 17:24:29
PHP
Kozlov, 2019-12-02 17:24:29

How to skip SQL errors?

I am writing to the sqlite database, using redbeanphp, the field is unique. When writing an already existing text, it gives http error 500.
How can I make it so that when writing an existing value, it is simply not written? No errors and http error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kozlov, 2019-12-02
@romandkoz

R::exec('INSERT OR IGNORE INTO table VALUES (null, "myvalue")') ;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question