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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,899
» Latest member: merlion
» Forum threads: 66,912
» Forum posts: 419,195

Full Statistics

Latest Threads
Update and Flash-data mes...
Forum: General Help
43 minutes ago
» Replies: 4   » Views: 77
Some functions in Control...
Forum: Best Practices
Yesterday, 12:16 PM
» Replies: 4   » Views: 106
Codeigniter 3 + HMVC (sub...
Forum: Addins
Yesterday, 11:12 AM
» Replies: 0   » Views: 74
Do you have a hobby?
Forum: Lounge
Yesterday, 10:02 AM
» Replies: 23   » Views: 4,548
ctype_digit() won't work ...
Forum: Installation & Setup
Yesterday, 05:28 AM
» Replies: 3   » Views: 114
$data array becomes varia...
Forum: Model-View-Controller
Yesterday, 04:29 AM
» Replies: 6   » Views: 958
Multiple table joins
Forum: General Help
11-16-2017, 11:37 PM
» Replies: 2   » Views: 121
database seeding
Forum: Addins
11-16-2017, 06:30 PM
» Replies: 4   » Views: 2,780
Any one know where i can ...
Forum: Lounge
11-16-2017, 12:34 PM
» Replies: 7   » Views: 504
Store Notification Messag...
Forum: Best Practices
11-16-2017, 09:29 AM
» Replies: 1   » Views: 102

 
  problem with Query database in routes.php file
Posted by: El Forum - 07-12-2007, 07:15 PM - Forum: Archived Development & Programming - Replies (3)

[eluser]widiastono[/eluser]
dear all,

I have problem to query database table in routes.php file, this the details story:

I have table in database which contains some filed

mic_modules
id
name
active

i want to query which modules name is actice and use it to route to my url, sample, if i get query news is active from my mic_modules tables so i can redirect to http://127.0.0.1/ci/index.php/news, but if i can't it when i access http://127.0.0.1/ci/index.php/news i will route to http://127.0.0.1/ci/index.php/default.

Simple explaination is i want to get which modules is active but i query it from database table.

any advice for this problem? please help...

widiastono


  Scaffolding Troubles
Posted by: El Forum - 07-12-2007, 07:13 PM - Forum: Archived Development & Programming - Replies (3)

[eluser]webdezzo[/eluser]
Hey all,

I am new to CI, and trying to get this puppy working. All is well until I try setting up scaffolding. I have tried the .htaccess implementations, and still am having no luck. It appears that the edit / insert / view functionality is working properly, but I keep getting php notices. I have set directive :

AddHandler application/x-httpd-php5 .php

in my .htaccess file as my host requires, and still nothing.

http://www.undecisive.com/index.php/blog/scaffolding

Thanks in advance!


  CI Version 1.5.4 Released
Posted by: El Forum - 07-12-2007, 05:21 PM - Forum: Archived General Discussion - Replies (29)

[eluser]Rick Ellis[/eluser]
Hello CI'ers... we've released version 1.5.4. It's primarily a maintenance release. For a list of all changes please see the Change Log. If you are currently running CodeIgniter please read the update instructions. Note: If you are still seeing the old documentation please clear your browser cache.


  pls do not change homepage language
Posted by: El Forum - 07-12-2007, 04:10 PM - Forum: Archived General Discussion - Replies (1)

[eluser]kucerar[/eluser]
Please continue to say CI kicks ass, or allows your programs to kick ass...somehow the current home page is so refreshing that I don't think it will last...


  Migration Advice
Posted by: El Forum - 07-12-2007, 03:51 PM - Forum: Archived General Discussion - Replies (4)

[eluser]richard_ctv[/eluser]
Hello.

I am in the process of planning the migration of two applications to CI. Both use 'legacy' code in that it mixes to a great degree php and html output. I am quite new to MVC frameworks but have been working an on app using CI for the last couple of weeks. It seems fairly simple to write something from scratch, but migration...

Both apps were written about 5 years ago, and require new features. I want to move them into CI as neither are MVC and adding new features means a lot more spaghetti code. And not having looked at the code for such a long time, I have to go through and work out how it all works! Probably better to do the migration and relearn (and clean up) the code as I go.

The structure of the main app is that it runs mostly of a single index.php file. You can read a full overview of the system in Linux Journal. The system is very stable and fast, just a bit messy to extend, hence the desire to move it to a framework. (We are about to move it to new faster hardware and update to php5 and mysql5, both from v4).

The app includes a whole bunch of files - for sessions, user authentication, cookies and access to objects in the database - and these are in directories below the site root. Fairly standard stuff. There is an additional large group of included files that contain classes for objects that represent items in the db. This is so I can go $object->print or $object->save and not have to worry about the underlying table differences.

There is also a complex query compiler that works in a similar way to the lucene query parser (although it pre-dates it), allowing complex search constructs. It also allows multiple data sources to be searched, regardless of the schema, and returned to the user in a simple format. This, I want to retain as it is what makes the system so powerful from the users' point of view (and represents a significant time investment).

I want to retain as much of the good code as possible, passing out data in arrays, as you do for MVC.

May main concern is how to move all the class files into CI in a structured and logical way, and then convert the descendant classes to be (i expect) libraries).

Other questions I have are: is search a library or a model. Ditto the object classes which access the DB.

Suggestions on restructuring this for CI and any other tips that come to mind would be appreciated!


regards,

Richard

======
basic structural overview:

root/htdocs/index.php
edit.php
help.php

root/includes/search.inc.php
other includes

root/includes/recordtypes/record.inc.php
other classes extended from record


  MySQL and extended ASCII
Posted by: El Forum - 07-12-2007, 02:16 PM - Forum: Archived Development & Programming - Replies (4)

[eluser]Xandrios[/eluser]
Hi,

I noticed that string values from my MySQL database are not properly printed with CI. A simple separate PHP script that echoes the same values works fine. However with CI (using an activerecord query) the 'á' will become an '?' and so on.

I am guessing this has something to do with some kind of Character encoding. The MySQL tables are set to 'latin1_swedish_ci'. Is it possible to somehow adjust the char encoding CI uses? Or could something else be the problem?

Running PHP5 with MySQL 5.

Thanks Smile


  FreakAuth isValidUser( ) problem
Posted by: El Forum - 07-12-2007, 01:32 PM - Forum: Archived Libraries & Helpers - Replies (2)

[eluser]Unknown[/eluser]
I have installed FreakAuth on my website and everything appears to be working. I use the isValidUser method to print a different menu for users that are logged in. This happens on every page that is displayed.

Whenever I login and navigate to any page within the website three times, the isValidUser method is no longer returning true and therefore shows the default menu.

My menu code looks like this:

Code:
<ul>
    <li>&lt;?=anchor('home', 'Home')?&gt;</li>
    &lt;?php if (isValidUser()) { ?&gt;
        <li>&lt;?=anchor($this->config->item('FAL_changePassword_uri'), 'Manage')?&gt;</li>
    &lt;?php } else { ?&gt;
        <li>&lt;?=anchor($this->config->item('FAL_register_uri'), 'Register')?&gt;</li>
    &lt;?php } ?&gt;
</ul>


  log_message when db_debug is false
Posted by: El Forum - 07-12-2007, 01:27 PM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]
For production code, I dont want to display database errors to the user via display_error, I want them logged to a file.

So I set:
- error_reporting(0) in index.php
- db_debug = FALSE in config/database.php
- set log_threshold appropriately in config/config.php
- make sure my logs directory is writable

This exposes a bug in DB_driver.php:

I think that code like this:
if ($this->db_debug)
{
log_message('error', 'Invalid query: '.$sql);
return $this->display_error('db_invalid_query');
}
should be changed to:
log_message('error', 'Invalid query: '.$sql);
if ($this->db_debug)
{
return $this->display_error('db_invalid_query');
}

so that database errors will be logged even when db_debug is false.

Many of the display_error instances in DB_driver.php are already written this way, but others (including 2 in the main query function) need this fix so that log_message will work when db_debug is false.


  Problem with escaping in query.
Posted by: El Forum - 07-12-2007, 01:02 PM - Forum: Archived General Discussion - Replies (1)

[eluser]Unknown[/eluser]
Hi, sorry for my english.

I have a problem with escaping in mysql queries. It looks so:

Code:
...
$data['age'] = 'age + 1';
echo $this->db->update_string('table', $data, $where)

This code returns "... age = 'age + 1'" and it does not have an effect.

Unfortunately i have to use this database class, because i use loops and i have different count of variables to update in query.

Thanks for answer.


  Spelling error 'unsuported'
Posted by: El Forum - 07-12-2007, 12:14 PM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]
If you search all codeigniter files with "grep -r unsuported" you will see 16 places where unsupported is misspelled.



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