parent
28d9f0dbba
commit
30d75445d9
22
Insert.md
Normal file
22
Insert.md
Normal file
@ -0,0 +1,22 @@
|
||||
There's 1 way to `Insert` items into the XMLDB:
|
||||
|
||||
## Insert Items
|
||||
|
||||
*Syntax:* `public function insertItem($id = null, $attributes = null, $childs = null, $table)`
|
||||
|
||||
*Example:*
|
||||
|
||||
```php
|
||||
$xmldb = new XMLDB('db.xml');
|
||||
$xmldb->insertItem('test', array('name'=>'alright'), array('visibility'=>'true', 'x'=>'33'), 'table1')
|
||||
```
|
||||
|
||||
This will insert the following item into _table1_
|
||||
`$id` can now be _null_ and *must* be _null_ if you use autoincrement. It will return `false` otherwise.
|
||||
|
||||
```xml
|
||||
<item id="test" name="alright">
|
||||
<visibility>true</visibility>
|
||||
<x>33</x>
|
||||
</item>
|
||||
```
|
Loading…
Reference in New Issue
Block a user