2006-07-23 21:08:06 +00:00
|
|
|
<?php
|
2006-08-21 22:51:27 +00:00
|
|
|
$user = $conn->create("User");
|
2006-07-23 21:08:06 +00:00
|
|
|
|
|
|
|
// alternative way:
|
|
|
|
|
2006-08-21 22:51:27 +00:00
|
|
|
$table = $conn->getTable("User");
|
2006-07-23 21:08:06 +00:00
|
|
|
|
|
|
|
$user = $table->create();
|
|
|
|
|
|
|
|
// the simpliest way:
|
|
|
|
|
|
|
|
$user = new User();
|
|
|
|
|
|
|
|
|
|
|
|
// records support array access
|
|
|
|
$user["name"] = "John Locke";
|
|
|
|
|
|
|
|
// save user into database
|
|
|
|
$user->save();
|
|
|
|
?>
|