TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 11-11-2009, 10:25 PM   #1 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default Edit post with CodeIgniter

I'm playing with CodeIgniter for the first time and I've managed to confuse myself. I've made a very simple blog script which I can add posts with, now I want to make an edit post page.

My controller looks like:
PHP Code:
    function edit_posts()
    {
        
$this->load->helper('form');
        
$this->load->model('posts_table');
        
$data['posts'] = $this->posts_table->edit_post();
        
$this->load->view('edit_posts'$data);
    } 
And the model:
PHP Code:
    function edit_post() 
    {
        
$this->db->where('id'$this->uri->segment(3));
        
$query $this->db->get('posts');
    } 
How do I display the stuff it gets from the database in my view? All the examples I can find use loops but I'm only displaying one result so I don't need a loop do I?
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
My post shows up as NEW allworknoplay Feedback 5 05-06-2009 01:35 PM
Venerable methods and the applications they are commonly trusted in. Village Idiot Tips & Tricks 7 11-06-2008 07:36 AM
Edit php.ini within PHP ETbyrne General 5 08-16-2008 12:35 PM
Edit Bug Haris Feedback 3 11-29-2007 02:19 AM


All times are GMT. The time now is 10:20 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design