codeigniter

Apache crashes, probably because of this piece of php code. Can you have a look?

I am working on the development of a web based application on codeigniter. I wrote this function to get the timezone data for any city or address. function gettimezone($address) { $_url = 'http://api.local.yahoo.com/MapsService/V1/geocode'; $_url .= sprintf('?appid=%s&location=%s',"phpclasses",rawurlencode($address))...

PHP Commercial Project Function define

Currently I am working with a commercial project with PHP. I think this question not really apply to PHP for all programming language, just want to discuss how your guys solve it. I work in MVC framework (CodeIgniter). all the database transaction code in model class. Previously, I seperate different search criteria with different fun...

SQL to CodeIgniter Array Missing Data Issue

$query = $this->db->query("SELECT t1.numberofbets, t1.profit, t2.seven_profit, t3.28profit, user.user_id, username, password, email, balance, user.date_added, activation_code, activated FROM user LEFT JOIN (SELECT user_id, SUM(amount_won) AS profit, count(tip_id) AS numberofbets FROM tip GROUP BY user_id) as t1 ON user.user_id = t1.user_...

codeigniter web servcies authenticate iphone's user

hi all, any helper or libraries for Codeigniter to authenticate iphone's user via webservices? sry for my bad english. ...

0.00 decimal fields in MySQL database giving empty value when in a PHP array

The fields read as 0.00 in phpMyAdmin, but when put into an array, the value is blank, is there a way to get it to show just '0'? From my Model: $query = $this->db->query("SELECT t1.numberofbets, t1.profit, t2.seven_profit, t3.28profit, user.user_id, username, PASSWORD , email, balance, user.date_added, activation_code, activated FROM...

Form not sending full data

I have a form with over 50 input fields. The input fields are divided into 5 jquery jabs within the form container. Here's a sample of what it looks like: <form action="admin/save" method="post" enctype="multipart/form-data"> <input type="hidden" name="type" value="department" /> <input type="hidden" name="id" value="21" /> ...

Access Codeigniter database functions from file

Hello. I am using a SWFupload script and I can't make a request from flash with mod_rewrite, I don't know why... I just need to point the Flash request to that file directly. This file runs an upload script that works ok but now I need to save some info to the database and I would like to know what should I write to have access from that...

What design pattern is Codeigniter using?

Fairly straightforward question: I know that Codeigniter is a MVC framework - however what design pattern is Codeigniter using? From first look it seems like Facade, but I could be wrong. Edit: Perhaps I should describe Codeigniter for those who don't use it. In Codeigniter you have a concept of a Controller and a Model, which each h...

CodeIgniter library multiple instances

Hey guys, I have got a problem with my codeigniter library. To transform database data into a navigation and have active elements and such like I build a library class CI_Navigation(). It works perfectly fine, I just have one problem. Often on webpages one has corresponding but separated navigations e.g. a main navigation at the top a...

How to send the my sql result to controller in codeigniter as a variable

Hi In my mode I am selecting a field as $query1 = $this->db->query("SELECT dPassword FROM tbl_login WHERE dEmailID='[email protected]'"); How to return dpassword as a variable to my controller I tried this way return dpassword; ...

Running CodeIgniter cron on localhost

I'm trying to get a cron job to run every 5 min on my localhost. Using the Cronnix app I entered the following command 0,5 * * * * root curl http://localhost:8888/site/ > /dev/null The script runs fine when I visit http://localhost:8888/site/ in my browser. I've read some stuff about getting CI to run on Cron, using wget and various ...

Dynamic data population in table form with Code Igniter

I have a pretty simple question, but for some reason I am drawing a blank. I have the following code in my view file, and I want to display the results in a two column table, so the first entry would be on the left, the next would be on the right then the next one after that would be below the first row, and eventually I will use the pag...

CodeIgniter and layouts?

What CodeIgniter library can provide this funcionality?? http://media.railscasts.com/videos/008_content_for.mov It seems so simple on rails but I just cant find a simple way to achieve this on codeigniter.. please help.. I hate having to insert my styles or javascript in the body of the document ...

routing problem in codeigniter

I'm new to CodeIgniter and routing. I have a Login controller whose index() loads up a view to enter a username/password. In the view, the form has action="login/authenticate". Login->authenticate() determines if the login is valid or not. If it's valid, redirect('lobby'), if not redirect('login') routes.php: $route['default_controlle...

CodeIgniter | direct Echo during working script

Is it possible to echo something while the script for example is still running in a loop? my problem: I ask the server with Ajax and then the server is fetching mails and store them in Database. This took around 15 sec. During that Time the Server should echo his progress so that the Javascript can update a loading bar. This is working ...

Variable in one query is getting into another query in view

I have two foreach statements. The variable from one one is somehow getting into another and i'm not sure how to fix it. Here's my controller: // Categories Page Code function categories($id) { $this->load->model('Business_model'); $data['businessList'] = $this->Business_model->categoryPageList($id); $...

Store LAST_INSERT_ID() in a transaction

Hi, I use codeigniter's database abstarction, and im doing a transaction with it. My problem is, that i have several inserts into several tables, but i need the insert id from the first insert query. Is there any way to store the last insert id for more than one following insert? I don't understand why, but the ci built in function doe...

Redirect CI problem

Hi I'm kind of new with CodeIgniter and I'm still learning (a lot). So I have a view and when I submit a form I 'call' the controller by surfing to the right URL dynamically e.g. site/delete class Site extends Controller { function index(){$this->load->view('...')} function delete() { $this->site_model->delete_ro...

In CodeIgniter, how to clear "form data" after redirecting page

I'm not sure I explained it correctly in the question title, so here's the details: Login controller: function authenticate() { if ( authorized ) { redirect('lobby'); } else { redirect('login'); } } Lobby controller: function index() { //load lobby view } What happens is that in the login page, I en...

Extend file upload class to use encryption

Is there an easy/straightforward way to extend the file upload class to encrypt files that are being uploaded? Not just encrypting the filename, but rather the data in the file itself. I'm using mcrypt for db encryption, and would prefer to use the same for file encryption. Looking through the Upload.php library, I don't see an obviou...