In your install.xml file that creates the table(s) for the block when someone installs the block, the XMLDB schema allows for a <STATEMENTS> container where you put <SENTENCE> 's that define records you want to go into the table(s).
The XMLDB editor will create the XML for you although I don't find it that intuitive to use. There's some documentation here.
That's just what i was after
cheers.
I try to add row into database but no effect.
My code:
<xmldb>
<tables>
//some tables
</tables>
<STATEMENTS>
<STATEMENT NAME="insert citaty_druh_media" TYPE="insert" TABLE="citaty_druh_media" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(id, druh_media) VALUES (1, '[online]')" />
</SENTENCES>
</STATEMENT>
<STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
<SENTENCES>
<SENTENCE TEXT="(module, action, mtable, field) VALUES ('guidedquiz', 'add', 'guidedquiz', 'name')" />
</SENTENCES>
</STATEMENT>
</STATEMENTS>
</xmldb>
What doing i wrong please ?
Hi!
I found out that STATEMENTS are no longer supported (my version is 2.4).
You must use db/install.php for your insert statements.