Location: PHPKode > scripts > PHPClass Generator > phpclass-generator/templates/func-store.tpl
function store()
{
    {db-func}

    if ( $this->{primarykey} ) // modify existing record
    {
        $q = mysql_query( "UPDATE {table-name} SET
                          {store-update-elements}
                          WHERE {primary-id}='$this->{primary-key}'" )
             or die( "{class-name}::store() \"modify\" failed, dying..." );
    }
    else // insert new record
    {
        $q = mysql_query( "INSERT INTO {table-name}
                           ({store-insert-variables})
                           VALUES({store-insert-values})
                          " )
             or die( "{class-name}::store() \"insert\" failed, dying..." );
    }

    return mysql_insert_id( $q );
}
Return current item: PHPClass Generator