The most Powerful tool in Eden
What are the things   you can do    in Mysql?
• Insert   • Update• Select • Delete
<?php//Create connection$connection =mysql_connect(‘localhost’, ‘root’, ‘’);mysql_select_db(‘eden’,$connection);
//Inserting Data$query = “INSERT INTO user (     user_name,     user_email,     user_password)VALUES (     ‘dan’,     ‘dan...
//Selecting Data$query = “SELECT * FROM userWHERE     user_email =     ‘danmichaelmolina@gmail.com’”;
//Updating Data$query = “UPDATE user SET    user_name = ‘dan michael’WHERE    user_email =    ‘danmichaelmolina@gmail.com’”;
//Deleting Data$query = “DELETE FROM userWHERE    user_email =    ‘danmichaelmolina@gmail.com’”;
//Execute your querymysql_query($query);//Close your connectionmysql_close($connection);//Get the result and output
Are You Tired of  doing that?
Guest What?
How Mysql in Eden     Works!
<?php//1. Include eden.php single fileInclude(‘eden.php’);//2. Create a DB connection$database = eden(     ‘mysql’,     ‘h...
Inserting Data Using Model//Set all fields you need//Then save$database->model()    ->setColumnName(‘*Value+’)    ->setCol...
//Set all fields you need//Then save$database->model()    ->setUserName(‘Dan’)    ->setUserPassword(‘123abc’)    ->save(‘u...
Select, Update & Deleting Data//Select data, update and save.$database->search(‘user’)      ->innerJoinOn(‘school’, ‘schoo...
SMTP
//Setup connection$smtp = eden(mail)->smtp(    ‘*smtp server+’,    ‘*email account+’,    ‘*password+’,    ‘*port+’, Boolea...
//Setup connection$smtp = eden(mail)->smtp(    ‘smtp.gmail.com’,    ‘dummy@gmail.com’,    ‘password’,    465, true);
//Complete your email$smtp->setSubject(‘*Subject+’)    ->setBody(‘*Body+’, Boolean)    ->addTo(‘*Email Account+’)    ->add...
//Complete your email$smtp->setSubject(‘Hello SMTP’)    ->setBody(‘<b>This is the body</b>’, true)    ->addTo(‘danmichaelm...
$smtp->disconnect();
Thank You!
Upcoming SlideShare
Loading in …5
×

Eden Hackathon Benilde (Mysql & SMTP)

715 views

Published on

This is the presentation ragarding Mysql & SMTP in Eden PHP Library. November 16, 2012 @ La Salle-College of Saint Benilde

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • .. SQL? SA ORACLE DATABASE yan wafo ahh :D
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total views
715
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Eden Hackathon Benilde (Mysql & SMTP)

  1. 1. The most Powerful tool in Eden
  2. 2. What are the things you can do in Mysql?
  3. 3. • Insert • Update• Select • Delete
  4. 4. <?php//Create connection$connection =mysql_connect(‘localhost’, ‘root’, ‘’);mysql_select_db(‘eden’,$connection);
  5. 5. //Inserting Data$query = “INSERT INTO user ( user_name, user_email, user_password)VALUES ( ‘dan’, ‘danmichaelmolina@gmail.com’, ‘1234abcd’)”;
  6. 6. //Selecting Data$query = “SELECT * FROM userWHERE user_email = ‘danmichaelmolina@gmail.com’”;
  7. 7. //Updating Data$query = “UPDATE user SET user_name = ‘dan michael’WHERE user_email = ‘danmichaelmolina@gmail.com’”;
  8. 8. //Deleting Data$query = “DELETE FROM userWHERE user_email = ‘danmichaelmolina@gmail.com’”;
  9. 9. //Execute your querymysql_query($query);//Close your connectionmysql_close($connection);//Get the result and output
  10. 10. Are You Tired of doing that?
  11. 11. Guest What?
  12. 12. How Mysql in Eden Works!
  13. 13. <?php//1. Include eden.php single fileInclude(‘eden.php’);//2. Create a DB connection$database = eden( ‘mysql’, ‘host’, ‘db_name’, ‘user’, ‘password’);
  14. 14. Inserting Data Using Model//Set all fields you need//Then save$database->model() ->setColumnName(‘*Value+’) ->setColumnName(‘*Value+’) ->save(‘*Table+’)
  15. 15. //Set all fields you need//Then save$database->model() ->setUserName(‘Dan’) ->setUserPassword(‘123abc’) ->save(‘user’)
  16. 16. Select, Update & Deleting Data//Select data, update and save.$database->search(‘user’) ->innerJoinOn(‘school’, ‘school_id = user_school’) ->leftJoinOn(‘address’, ‘address_user = user_id’) ->getCollection() ->setAddressCreated(time()) ->setSchoolYear(‘2010 - 2012’) ->setAddressCity(‘Makati’) ->copy(‘user_id’, ‘address_user’) ->save(‘school’) ->save(‘address’);
  17. 17. SMTP
  18. 18. //Setup connection$smtp = eden(mail)->smtp( ‘*smtp server+’, ‘*email account+’, ‘*password+’, ‘*port+’, Boolean);
  19. 19. //Setup connection$smtp = eden(mail)->smtp( ‘smtp.gmail.com’, ‘dummy@gmail.com’, ‘password’, 465, true);
  20. 20. //Complete your email$smtp->setSubject(‘*Subject+’) ->setBody(‘*Body+’, Boolean) ->addTo(‘*Email Account+’) ->addCC(‘*Email Account+’) ->addBCC(‘*Email Account+’) ->addAttachment( ‘*Filename+’, ‘*File Path+’, ‘*Image Mime+’) ->send();
  21. 21. //Complete your email$smtp->setSubject(‘Hello SMTP’) ->setBody(‘<b>This is the body</b>’, true) ->addTo(‘danmichaelmolina@gmail.com’) ->addCC(‘dummy@gmail’) ->addBCC(‘dummy@gmail.com’) ->addAttachment( ‘file.jpg’, ‘/path/file.jpg’, ‘mime-type’) ->send();
  22. 22. $smtp->disconnect();
  23. 23. Thank You!

×