Help for this page

Select Code to Download


  1. or download this
    
    #This is file: Users.pm
    ...
    Users->columns(All => qw/id username password created/);
    
    1;
    
  2. or download this
    #This is file: my_prog.pl
    
    ...
    );
    
    say $user1->username;  #Joe
    
  3. or download this
    my $id = 1; 
    my $user = Users->retrieve($id);
    say $user->username;    #Joe
    
  4. or download this
    my $user2 = Users->insert(
        {
    ...
        }
    );
    
  5. or download this
    my @users = Users->retrieve_all;
    
    ...
    Jim
    456
    2013-02-02 00:12:00
    
  6. or download this
    for my $user (@users) {
        printf "%s %s %s \n",
    ...
    --output:--
    Joe 123 2013-02-02 00:12:00
    Jim 456 2013-02-02 00:12:00
    
  7. or download this
    $user2->username("Kathy");
    $user2->update;
    
  8. or download this
    $user1->delete;
    
  9. or download this
    #This is file: MyDBIDatabase.pm
    
    ...
    #Format is: (dbi:<database_type>:<db_name>, <username>, <password>)
    
    1;   #Don't forget this!
    
  10. or download this
    #This is file: Users.pm
    
    ...
    Users->columns(All => qw/id username password created/);
    
    1;
    
  11. or download this
    #This is file: MyApp/MyDBIDatabase.pm
    
    ...
    #Format is: (dbi:<database_type>:<db_name>, <username>, <password>)
    
    1;   #Don't forget this!
    
  12. or download this
    #This is file: MyApp/Users.pm
    
    ...
    MyApp::Users->columns(All => qw/id username password created/);
    
    1;
    
  13. or download this
    #This is file: my_prog.pl
    
    ...
    #Same as my_prog.pl above with 'Users' replaced by 'MyApp::Users'
    #everywhere in the code.
    #