simple crud on codeigniter


Rahul's Work

sql:

CREATE TABLE IF NOT EXISTS `tbl_person` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `gender` char(1) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;



INSERT INTO `tbl_person` (`id`, `name`, `gender`, `dob`) VALUES
(1, 'henrihnr', 'm', '1985-09-09'),
(2, 'name_001', 'm', '1990-01-01'),
(3, 'name_002', 'f', '2000-01-01'),
(4, 'name_003', 'm', '2000-02-02'),
(5, 'name_005', 'f', '2000-04-04'),
(6, 'khushbu', 'f', '1983-08-10'),
(10, 'rahul mehta', 'm', '1983-05-16'),
(11, 'jatin', 'm', '1983-05-16');

 

application/views/personadd.php

<html>
<head>
<title>person add</title>
</head>
<body>
    <h1>Person add</h1><a href="/">list</a>
    <form name="add"   method="POST" action="insert">
<table border="1">
<tr>
<th>name</th>
<td><input type="text" name="name"/></td>
<tr>
<th>gender </th>
<td><input type="text" name="gender"/></td>
<tr>
<th>dob </th>
<td><input type="text" name="dob"/></td>
</tr>
<tr>
<td><input type="submit"></td>
<td><input type="reset"></td>
</tr>
</form>
</table> 
</body
</html>

application/views/personedit.php

<html> <head> <title>person edit</title> </head> <body>     <h1>Person edit</h1><a href="/">list</a>     <form name="add"   method="POST" action="/index.php/person/update">             <input type="hidden" name="id" value="<?php echo $person[0]->id…

View original post 415 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s