PHP and Postgres: catching errors?

前端 未结 2 1765
萌比男神i
萌比男神i 2020-12-11 21:38

How should I prepare the code if it something fails? With try-catch statement or?

function delete_question ( $question_id ) {
    $dbconn =          


        
2条回答
  •  伪装坚强ぢ
    2020-12-11 22:13

    I have another practice

    $result = pg_query_params ( $dbconn,'DELETE FROM questions WHERE question_id = $1', array ( $question_id ) )
              or die(pg_last_error($dbconn));
    

提交回复
热议问题