This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jak0b
jak0b

Hello,

I have stored additional tables with information in the database, I also know how to read and output these with PHP and an SQL statement. However, I don't know which way to go so that it also works in OCMS (in a created new page). Simple queries cannot be implemented, as this always ends in an error.

Greetings

daftspunky
daftspunky

Take a look at the Database introduction documentation page. It shows you how to run a RAW SQL query...

To select

$results = Db::select('select * from users where id = :id', ['id' => 1]);

To insert

Db::insert('insert into users (id, name) values (?, ?)', [1, 'Joe']);

If something ends in an error, it should only be related to the SQL query

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.