Concrete 5.7database query documentation

173 Views Asked by At

New to concrete and trying to find some consistent doc on how to do insert, delete, update, etc. Docs say it follows doctrine\dbal, which is I read correclty should look like this:

$db = \Database::connection(); $db->insert('user', array('username' => 'jwage'));

But I haven't gotten that to work. Digging through the code I find it being done like this,

$db->execute('INSERT INTO gift_cert (bname) values(?)',
array($CardHoldersName)
);

Which does work, is this the new way, or the old way. Does someone have a link to docs that show all the possible commands and format somewhere? I can't seem to find it in the API docs. Thanks for the help.

1

There are 1 best solutions below

0
Jakob Fuchs On

This doc outlines how to connect to the database and which methods are available:

https://documentation.concrete5.org/developers/appendix/concrete5-version-8-coding-styles/database