Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update statement with different id column not working #6

Open
Hinkie opened this issue Dec 31, 2017 · 0 comments
Open

Update statement with different id column not working #6

Hinkie opened this issue Dec 31, 2017 · 0 comments

Comments

@Hinkie
Copy link

Hinkie commented Dec 31, 2017

Hello, the following function wasn't working for me:
$db->updateCliente('cliente', [ 'nome_cliente' => $nome_cliente, 'tel1' => $tel1, 'tel2' => $tel2, 'endereco' => $endereco ],['id_cliente',1]);

So I used var_dump and got:
...UPDATE cliente SET nome_cliente = ?,tel1 = ?, te2l = ?, endereco = ? WHERE id = ?"...

The issue is that 'id' didn't chage to 'id_cliente'.
To fix that I copied the update function and manually changed line 241 from
$this->where .= "id = ?";

To

$this->where .= "id_cliente = ?";

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant