phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


CodeIgniter: Showing Simple One Data

Tag: CodeIgniter, framework, mvc, database   Category: PHP Framework
post: 26 Jan 2008 read: 3,552


CodeIgniter Step By Step Tutorial: After show all data, We learn how to show one data. We want a data with certain ID, example ID = 1. We still use same files with previous practice.

For model: Open "employee_model.php" within CodeIgniter\system\application\models. Add following function:

codeigniter model

For Controller: Open "employee.php" within CodeIgniter\system\application\controllers. Add following function:

codeigniter controller

For View: Open "employee_view.php" within CodeIgniter\system\application\views. Enter following code:

codeigniter view

Now, test it. Point your browser to http://localhost/CodeIgniter/index.php/employee/get.

codeigniter result



Series this article:
CodeIgniter: Introduction to CodeIgniter Framework
CodeIgniter: Installation
CodeIgniter: Creating First Application at CodeIgniter
CodeIgniter: Creating and Sending Parameters Between Controller and View
CodeIgniter: Getting Parameters From GET
CodeIgniter: Setting Database Configuration
CodeIgniter: Preparing Database
CodeIgniter: Showing Simple All Data
CodeIgniter: Showing Simple One Data
CodeIgniter: Choosing a Data From GET

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Joomla: Fast Road to Understand Component Programming
Chart: How to Build Cool Animation Real Time Chart
Email: Send Attachement Mail
SMS : Sending SMS with PHP and ActiveXperts (Part 1)

1 Responses to CodeIgniter: Showing Simple One Data:

Dear Sir,

You tutorial is great and thank's for it but can i noticed for lines 18 on employee_model.php page, you write "getwhere", it should get_where. Please fix it :), it makes variable "query" not undifined.

Best Regards,


Saut M. Napitupulu

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


624
posting