diff --git a/scripts/snippets/model.php b/scripts/snippets/model.php new file mode 100644 index 00000000..5c36ba0d --- /dev/null +++ b/scripts/snippets/model.php @@ -0,0 +1,47 @@ +insert($this->table, $this->values); + #pseudocode else + $db->update( $this->table, $this->id, $this->values ); + } + + public load( $parameter = array() ) { + ##pseudocode if where is key in parameters + $w = $parameters['where']; # where = array('column', 'value' ) + $sql = " WHERE $where['column'] = $where['value']"; + ## elseif limit is key in parameters + $l = $parameter['limit'] + $sq = " LIMIT $l[1], $l[2]"; + + + $db->query("SELECT * FROM $this->table $sql"); + } + + +} + + + + +//No closing tag only in index.php +//index.php needs drupal like path syntax like ?q=domain/new or ?q=domain/example.com or ?q=domain/example.com/edit +//which loads the needed controller and view. \ No newline at end of file