mevdschee / mevdschee/php-crud-api

Access to db in handler

Open
#919 4 comments 0 reactions 1 assignee View on GitHub

@mevdschee is already working on this.

Since Oct 4, 2022.

enhancement
Dominant language
PHP
Stars
3.7k
Forks
1k
Avg merge
1h 55m
Merged PRs (30d)
7

Description

Hi, I'm not really a PHP guru.
I would like to check if a field called "oid" is currently null while updating. If the actual value in the DB is null, an update should be possible, otherwise no update should be made.

I think the validation handler would be the right place for this. My problem is how to access the database from the handler?
Can I reuse any function without opening a complete new connection to the db?

Or should I put it in another place? If so where?

Hope you can help me.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.