susanBuck / e2-fall22

0 stars 0 forks source link

update database table #57

Closed bar181 closed 1 year ago

bar181 commented 1 year ago

I am updating database tables during for a blackjack game.

To do this, I created a method that will dynamically create the SQL statement (#sql) with named parameters as well as a data array ($data) containing the values. It uses the built in run method i.e. $app->db()->run(string $sql, array $data).

I see the documentation refers to using this run method for fetch etc. and want to confirm it okay to update database tables for this project?

RobertHolzhauser commented 1 year ago

From what I understand, it's allowed, but not required.

susanBuck commented 1 year ago

Hi @bar181 Yes, you can use the db run method and SQL if one of the existing db helper methods doesn't fit the needs of what you're trying to do.