1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CodeIgniter Project Startup

Discussion in 'Web Development' started by LPH, Jan 21, 2013.

  1. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
     
  2. Albert Jr

    Albert Jr Dogs Times Writer

    Likes Received:
    8
    Thanks for the tip.

    LPH - Did you install this for a particular reason?
     
  3. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    Yes. Research notes is presently in Caspio. Not having control over the database really bothers me. Plus, they charge a lot for data transfers. The project is better to be in MySQL, PHP, and on this server.

    One more reason - less lines of code.

    For example, this is the code for pulling the latest articles from Research Notes. It is far fewer lines than were used outside of the framework.

    Code (Text):
    1. <?php
    2.  
    3. /* Script to pull the latest articles from Research Notes */    
    4.  
    5. $this->load->database();
    6. echo "<strong>Latest Articles in Research Notes</strong><br />";
    7. $notes = $this->db->query("
    8.         SELECT * FROM notes
    9.         ORDER BY `note_id` DESC
    10.         LIMIT 5
    11.       ");
    12.  
    13. foreach ($notes->result_array() as $note)
    14. {
    15.   echo( "<a href='" . $note['original_URL'] . "'>" . $note['title'] .  "</a> <br />");
    16. }
    17. ?>
    Also, because I was able to tie the framework to WordPress, the header and footer automatically are pulled into the application.

    This is the result. It took a few hours to get this right (tied to WP, learn to call query, echo the proper results). Still. Not bad for someone just learning PHP.

    Screen Shot 2013-01-21 at 5.19.26 PM.png
     
    • Like Like x 1
  4. Albert

    Albert Technology Writer

    Likes Received:
    36
    Awesome. You are making progress.
     

Share This Page