Welcome, Guest
You have to register before you can post on our site.

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,468
» Latest member: w38g0ru
» Forum threads: 67,214
» Forum posts: 420,672

Full Statistics

Latest Threads
Query inside transaction
Forum: General Help
1 hour ago
» Replies: 6   » Views: 111
Using ajax with codeignit...
Forum: General Help
3 hours ago
» Replies: 5   » Views: 171
debugging javascript in a...
Forum: Lounge
5 hours ago
» Replies: 4   » Views: 68
Change gmail id for captc...
Forum: Lounge
9 hours ago
» Replies: 7   » Views: 196
PDO Drivers
Forum: CodeIgniter 3.x
9 hours ago
» Replies: 5   » Views: 212
MySql / MariaDB Connectio...
Forum: CodeIgniter 3.x
11 hours ago
» Replies: 2   » Views: 94
Codeigniter CLI does not ...
Forum: General Help
11 hours ago
» Replies: 9   » Views: 108
Facebook login
Forum: General Help
Yesterday, 01:11 PM
» Replies: 5   » Views: 228
Access to model functions...
Forum: Libraries & Helpers
Yesterday, 12:38 PM
» Replies: 1   » Views: 33
Session system
Forum: General Help
Yesterday, 12:10 PM
» Replies: 9   » Views: 136

 
  Please point me in the right direction for this DB oriented project.
Posted by: El Forum - 07-28-2007, 12:53 PM - Forum: Archived Development & Programming - Replies (1)

[eluser]walterbyrd[/eluser]
Although I'm making fair good progress. I am just now learning codeignitor.

I am working on a database oriented project for an HOA. There will be about 1000 records, and some relational work. I think the project will be mostly CRUD oriented. I will also need different levels of user authentication. There will be forms and reports. I would love to have inline editing, but I doubt I can get that, even with a third part library.

I am wondering if codeignitor is good choice for such a project. Codeignitor does not seem to do crud natively. I know there are 3rd party libraries, but I'm a little less comfortable with that. Codeignitor also does not seem to have any sort of native authentication - but I guess I can write my own.

I suppose the two third party apps, that might be helpful for me, would be Rapyd or CodeCrafter. Of those two, which would be more appropriate for this project? Or, for this particular project, maybe I'd be better off with another tool? I was also looking at AutoCRUD - I don't know if anybody knows anything about that. I was also thinking about CakePHP.

Any advice, or relevant information would be appreciated.


  Using normal PHP classes
Posted by: El Forum - 07-28-2007, 10:01 AM - Forum: Archived Development & Programming - Replies (7)

[eluser]robert.isenberg[/eluser]
Hi,

I've got a quite a lot of experience using codeigniter to develop web sites, but I'm taking over work on a web application that has some pre-existing PHP classes. I want to re-use these classes and just plug them into Codeigniter. Is this possible?

Is it just a matter of doing:

include_once("class_name")

wherever I need it, whether that be in a Controller class or Model class etc?

Any thoughts would be greatly appreciated.


  Email sending - Undefined index: Form
Posted by: El Forum - 07-28-2007, 06:58 AM - Forum: Archived Development & Programming - Replies (3)

[eluser]Ji31[/eluser]
Hi,

I have already written almost whole my application by reading of User Guide an searching the forum, but now I'm out, so I registered.

I'm trying to send the email, but I get this error:

Code:
[b]A PHP Error was encountered[/b]

Severity: Notice

Message: Undefined index: From

Filename: libraries/Email.php

Line Number: 1160
Code:
[b]A PHP Error was encountered[/b]

Severity: Notice

Message: Undefined index: From

Filename: libraries/Email.php

Line Number: 850
Code:
[b]A PHP Error was encountered[/b]

Severity: Notice

Message: Undefined index: Return-Path

Filename: libraries/Email.php

Line Number: 525
Code:
[b]A PHP Error was encountered[/b]

Severity: Notice

Message: Undefined index: Subject

Filename: libraries/Email.php

Line Number: 869
Code:
[b]A PHP Error was encountered[/b]

Severity: Notice

Message: Undefined index: From

Filename: libraries/Email.php

Line Number: 1328
Code:
[b]A PHP Error was encountered[/b]

Severity: Warning

Message: mail() expects parameter 1 to be string, array given

Filename: libraries/Email.php

Line Number: 1328
Code:
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
Code:
User-Agent: CodeIgniter
Date: Sat, 28 Jul 2007 13:46:11 +0200
Reply-To: "" <>
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <46ab2c833b07d>
Mime-Version: 1.0

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Is there something wrong with my form? I have my form in the view as:
Code:
echo"
<div class=\"yes\">".form_open('articles/apply')."<table cellpadding.....

Does it matter?

Thanks


  [Solved!] - HELP!: mysql result from COUNT(*) query
Posted by: El Forum - 07-28-2007, 05:05 AM - Forum: Archived General Discussion - Replies (3)

[eluser]gunter[/eluser]
I want know how many rows have parentid = '38'...


Code:
$sql = "SELECT COUNT(*) FROM s3album WHERE parentid = '38'";
        $query = $this->db->query($sql);
        $result = $query->row();
        print_r($result);
I am getting this:
Code:
stdClass Object ( [COUNT(*)] => 2 )

how can I get the result?
with echo $result->?????


  [Help] Why is nothing to display when I set "$autoload['libraries'] = array('database');" in autoload.php ?
Posted by: El Forum - 07-28-2007, 04:28 AM - Forum: Archived General Discussion - Replies (11)

[eluser]Luwian[/eluser]
Hiya,

I am a dub for the php and I just test the CI through the video tutorials.

I have a problem is that why my browser display nothing when I set
$autoload['libraries'] = array('database');
in autoload.php.

and if not to set it, there is a error message, which looks like

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Testdb::$db

Filename: controllers/testdb.php

Line Number: 13


Thx


  Layout Library Question
Posted by: El Forum - 07-28-2007, 12:32 AM - Forum: Archived Libraries & Helpers - Replies (1)

[eluser]psylence[/eluser]
I found this Lib in the wiki HERE.

But anyway,
I wanna know how exactly to set up the controller file mentioned in that Wiki Page.
Ive read about controllers in the user-guide, but will admit to being a bit of a slow learner.

incase you dont wanna click the link...here's a quote from the wiki:

Quote:In Your Controller:

Place this in the Controllers Constructor:
$this->load->library('layout', 'layout_main');

Place this in the Controllers Methods:
$this->layout->view('/shop/view_cart', $data);


  Ext.js + CodeIgniter (example application)
Posted by: El Forum - 07-27-2007, 09:22 PM - Forum: Archived General Discussion - Replies (25)

[eluser]alexsancho[/eluser]
I want to share this little experiment. There's a custom implementation of ext framework with CI to provide a single interface to deal with db operations. The demo shows a user management grid with add, update, delete, list and search features.

Code is available for download, i love to see your comments and suggestions.

Happy coding


  How to deal with mySQL JOINS with identical column names in two or more tables?
Posted by: El Forum - 07-27-2007, 06:35 PM - Forum: Archived Development & Programming - Replies (4)

[eluser]smalljohnson[/eluser]
Hi,

I have a mySQL question. I am trying to perform a LEFT JOIN on two tables. The two tables have a couple of identically named columns (CreatedDate and ModifiedDate). When I perform a LEFT JOIN and print_r the results, any of the non-unique columns are shown only once (shows the value from the table to the left of the JOIN clause - the Members.CreatedDate and Members.ModifiedDate in this case).

Is there a way to have the query return the CreatedDate and ModifiedDate from both tables without giving them unique names in the table? I know that I could use 'AS' but that would get very tedious as I have about 20 different tables in my db with several having idential column names.

Code:
CREATE TABLE `Members` (
  `MemberID' INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  `FirstName` VARCHAR( 100 ) NOT NULL ,
  `LastName` VARCHAR( 100 ) NOT NULL ,
  `CreatedDate` timestamp(14) NOT NULL,
  `ModifiedDate` timestamp(14) NOT NULL
  );

  CREATE TABLE `Addresses` (
  `AddressID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `MemberID_fk` INT NOT NULL default '0',
  `AddressType` VARCHAR( 20 ) NOT NULL ,
  `Address` VARCHAR( 100 ) NOT NULL ,
  `City` VARCHAR( 100 ) NOT NULL ,
  `State` VARCHAR( 100 ) NOT NULL ,
  `CreatedDate` timestamp(14) NOT NULL,
  `ModifiedDate` timestamp(14) NOT NULL
  );


$sql = "SELECT *
        From Members
        LEFT JOIN Addresses ON Addresses.MemberID_fk = Members.MemberID
       ";

$query = $this->db->query($sql)

foreach($query->result() as $row):
      print_r($row);
      echo "<br>";
endforeach;


  Sample CodeIgniter Application (shows sessions, Ajax, and models) with source code
Posted by: El Forum - 07-27-2007, 04:38 PM - Forum: Archived General Discussion - Replies (2)

[eluser]Unknown[/eluser]
I was working on this non-production CodeIgniter application and I’ve think I’m pretty much done with it. I used it as a learning experience and now would like to pass it on to you, whether for reference, curiosity, or pure entertainment. Admittedly, I could have done better with the conventions and programming style but I believe I did a good job implementing models and using Prototype with script.aculo.us for Ajax functionality.

Check out the application at http://codeigniter.paulshen.name/index.php
Click the Login link and use the credentials: demo/password
Try messing around with the interface: adding, editing and deleting stuff

Link to source code and notes
Take a look!

Post comments or questions, I'll be happy to answer Smile


  Simple form, crazy error
Posted by: El Forum - 07-27-2007, 03:23 PM - Forum: Archived Development & Programming - Replies (6)

[eluser]RaZoR LeGaCy[/eluser]
Hi I have in my controller:

Code:
function submit()
    {
                
$rules['title']    = "trim|required|xss_clean|prep_for_form|htmlspecialchars";
$rules['date']    = "trim|required|xss_clean|prep_for_form|htmlspecialchars";
$rules['desc']    = "trim|xss_clean|prep_for_form|htmlspecialchars";
        
$this->validation->set_rules($rules);
        
$fields['title'] = 'title';
$fields['date'] = 'date';
$fields['desc'] = 'desc';

$this->validation->set_fields($fields);


        if ($this->validation->run() == FALSE)
        {

#Body View
echo '<center><p>There was an <strong>Error</strong> with your comment.</p>';
echo '<p>Please re-submit your entry!</p>';

        }
        else
        {

if (!empty($_POST['dvd'])) {
$dvd = '1';
} else {
$dvd = '0';
}

if (!empty($_POST['theater'])) {
$theater = '1';
} else {
$theater = '0';
}

if (!empty($_POST['game'])) {
$game = '1';
} else {
$game = '0';
}

        
$data = array(
               'id' => 'NULL' ,
               'title' => $this->input->post('title', TRUE) ,
               'desc' => $this->input->post("desc", TRUE) ,
               'date' => $this->input->post('date', TRUE) ,
               'dvd' =>  ''.$dvd.'' ,
               'theater' => ''.$theater.'' ,
               'game' => ''.$game.'');

$this->db->insert('hh_events', $data);

redirect('razor/events/');

}

}

In my View:
Code:
<div class="storyBar">
<h1>Events</h1>

<center>
&lt;?=$this->validation->error_string; ?&gt;

&lt;?=form_open('razor/events/submit');?&gt;

<table align="center" style="margin:2em auto;">
<tr valign="baseline">
<td colspan="2" align="center">
DVD: &lt;? echo form_checkbox('dvd', '1', FALSE); ?&gt; |
Theater: &lt;? echo form_checkbox('theater', '1', FALSE); ?&gt; |
Game: &lt;? echo form_checkbox('game', '1', FALSE); ?&gt;
<tr valign="baseline">
<td align="right" valign="top" nowrap="nowrap">Title:</td>
<td>&lt;?
$data = array('name' => 'title', 'id' => 'title', 'value' => '', 'maxlength' => '128', 'size' => '50', 'style' => 'width:50%',);
echo form_input($data);
?&gt;</td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap="nowrap">Date:</td>
<td>&lt;?
$data = array('name' => 'date', 'id' => 'date', 'value' => '2007-00-00', 'maxlength' => '10', 'size' => '15', 'style' => 'width:50%',);
echo form_input($data);
?&gt; YYYY-MM-DD</td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap="nowrap">Desc:</td>
<td>&lt;? $data = array('name' => 'desc', 'id' => 'comment', 'cols' => '40', 'rows' => '3',);
echo form_textarea($data);?&gt;</td>
</tr>
<tr valign="baseline">
<td colspan="2" align="center">

&lt;?=form_submit('submit', 'Submit');?&gt;</td></tr>
</table>
&lt;/form&gt;
</center>

</div>

In my DB structure:
Code:
-- phpMyAdmin SQL Dump
-- version 2.10.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 27, 2007 at 02:21 PM
-- Server version: 5.0.27
-- PHP Version: 4.4.4

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `gainfina_ciHH`
--

-- --------------------------------------------------------

--
-- Table structure for table `hh_events`
--

CREATE TABLE `hh_events` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(128) collate utf8_unicode_ci NOT NULL default '',
  `desc` text collate utf8_unicode_ci,
  `date` date NOT NULL default '0000-00-00',
  `dvd` enum('1','0') collate utf8_unicode_ci NOT NULL default '0',
  `theater` enum('1','0') collate utf8_unicode_ci NOT NULL default '0',
  `game` enum('1','0') collate utf8_unicode_ci NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='release_dates' AUTO_INCREMENT=36 ;

--
-- Dumping data for table `hh_events`
--

INSERT INTO `hh_events` VALUES (1, 'Skinwalkers', NULL, '2007-07-27', '0', '1', '0');
INSERT INTO `hh_events` VALUES (2, 'Shadow Puppets', NULL, '2007-07-24', '1', '0', '0');
INSERT INTO `hh_events` VALUES (19, 'Perfect Creature', NULL, '2007-07-17', '1', '', '');
INSERT INTO `hh_events` VALUES (20, 'Captivity', NULL, '2007-07-13', '', '1', '');
everything looks good but I get this error when I submit
Code:
An Error Was Encountered

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, date, dvd, theater, game) VALUES ('NULL', 'the2', 'te 2\'s', '2007-08-14',' at line 1

INSERT INTO hh_events (id, title, desc, date, dvd, theater, game) VALUES ('NULL', 'the2', 'te 2\'s', '2007-08-14', '0', '1', '0')



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.