Welcome Guest, Not a member yet? Register   Sign In
  codeignitors database query cache VS. MySQL query cache
Posted by: El Forum - 10-21-2007, 04:22 AM - Replies (2)

[eluser]dreamynsx[/eluser]
Hello!

Okay, so here I found CI's db caching mechanisim, which essentially caches queries/results into file system
http://ellislab.com/codeigniter/user-gui...ching.html

And here, is info on MySQL's query cache mechanism, which caches queries/results into memory
http://dev.mysql.com/doc/refman/5.0/en/query-cache.html


Big Broad Questions
Which one is better?
Are they the same functionally?
Which is better for performance in single server environment?
MySQL's query cache can't cache SELECTS with RAND() for example, can CI's DB query cache?

Any other thing good to know? Thanks!


  anchor(), scaffolding error
Posted by: El Forum - 10-21-2007, 03:43 AM - Replies (1)

[eluser]Unknown[/eluser]
Hi,
Just started using CI - very nice Smile
A totally default installation gives a warning of:

A PHP Error was encountered
Severity: Warning
Message: preg_match() expects parameter 2 to be string, array given
Filename: helpers/url_helper.php
Line Number: 93

when using the scaffolding.
Tracking back through the code I see the 'view' model in scaffolding uses :

<?php echo anchor(array($base_uri, 'edit', $row->$primary), $scaff_edit); ?>

Would it be useful to add 2 lines of code into the anchor() function in the URI helper as follows:

function anchor($uri = '', $title = '', $attributes = '')
{
if (is_array($uri))
$uri=implode('',$uri); // --EDIT-- :- or perhaps I meant implode on '/' ! I think I probably did Smile
.... existing code ...
}

This would stop the warning message. I don't know if this would affect the code in ways I haven't thought about though !

Regards


  Modified Validation Library (multi-dimensional arrays)
Posted by: El Forum - 10-21-2007, 01:54 AM - No Replies

[eluser]Majd Taby[/eluser]
Here's an example: http://citastic.com/multi-dimensional%20post%20data.mov

and here's the code..just replace your version, and everything works the way it's outlined in the user_guide: http://jtaby.com:82/svn_portal/trunk/sys...dation.php

Please let me know what you think, and if you find any bugs...enjoy!

To Install: Just replace the Validation library in system/libraries


  highly dynamic user data.
Posted by: El Forum - 10-21-2007, 01:46 AM - No Replies

[eluser]gops[/eluser]
I have created an application with all usual stuff like user login/logout and sessions.

I want to know , What is the best way to store the misc. user data ? , like

last logins , their fav page on website , bookmarks etc. without dealing too much with mysql. ( i dont want to create a table and/or field for every new thing i want to store).

first idea is to get a huge array storing all the data ,serialzie it and store it in text fields. but then, i need to retrieve the whole data , for even a simple small amount of data,that i needed to look for.

I want to know , what everybody else is doing ? , what is ideal thing from performance point of view ?


tell me if i haven't make myself clear.


  New user, having a couple of issues
Posted by: El Forum - 10-20-2007, 11:51 PM - No Replies

[eluser]darkpedro[/eluser]
Hi there. I'm a new user to both PHP and CI. I've gone through the tutorials and a couple of other CI tutorials that I've found.

So, I get stuck on all the forms tutorial for the dumbest reason. For some reason I cannot get a submit button to work. I get everything to display, I can fill things in, but when I click submit, nothing happens.

I'm using

Code:
<php echo form_open('form/submit'); ?&gt;
to open,
Code:
&lt;?php echo form_submit('submit', 'Submit'); ?&gt;
for the button, and
Code:
&lt;?php echo form_close(); ?&gt;
to close but I'm stuck at this point.

Does anyone have any suggestions? Is learning CI alongside of PHP even a good idea? Thanks for your help.

edit:
I've also autoloaded the 'url' and 'form' helpers.


  Yet another validation question
Posted by: El Forum - 10-20-2007, 10:55 PM - No Replies

[eluser]yello[/eluser]
Hi!

I am building some kind of social networking website right now and I am having this dilema:

my urls look like this:

domain.com/browse/state/city/username

each username has a form on their page so people can send them message... i'm trying to set simple validations on each of the profile's pages...

Code:
function send()
    {
        $this->load->library('validation');
        
        $rules['name']    = "required";
        $rules['email']        = "required";
        
        $this->validation->set_rules($rules);
        if ($this->validation->run() == FALSE)
        {
            *What do I put here to make them redirect to the user profile page?*
        }
        else
        {
            echo("success");
        }
    }

Since it is not a 'static' form with a static url/view, I don't know how to redirect the user on the correct user profile if their is an error in the validation process.

Can someone help me on this one?
Thanks!


  Better Urls?
Posted by: El Forum - 10-20-2007, 09:59 PM - No Replies

[eluser]lszanto[/eluser]
Hey, I am just needing a bit of help with .htaccess/mod_rewrite and wanted to know how do I configure my webserver/.htaccess file so that instead of showing /index.php/mypage it will skip the index.php so your url would be http://yourpage.com/codeigniter/mypage.

Thanks in advance.


  Scaffolding and Error 1064
Posted by: El Forum - 10-20-2007, 05:41 PM - No Replies

[eluser]Unknown[/eluser]
Hello, I'm very new to CI and quite new to MySQL, so I have no idea where this might be coming from. I did a search and found a few similar errors, but nothing that explained how I might fix it.

Basically, I wanted to use scaffolding to insert a few entries into my feeds table. I got this error:

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, feedURI, feedVer, siteURI, lastRetrieved, lastAttempt, errorMsg) VALUES ('' at line 1

INSERT INTO feeds (title, desc, feedURI, feedVer, siteURI, lastRetrieved, lastAttempt, errorMsg) VALUES ('Testing it again', 'Is the problem the name of the table?', 'http://something.xyz', 'rss', '', '', '', '')

An ideas? Thanks for the help!


  Pagination help
Posted by: El Forum - 10-20-2007, 01:14 PM - No Replies

[eluser]feri_soft[/eluser]
I have a default controller set to products.

and i have this code for pagination:

Code:
class Products extends Controller
{

    function __construct()
    {
        parent::Controller();

    }

    function index()
    {
        
        $this->load->library('pagination');
        $config['base_url'] = base_url(). 'products/';
        $config['total_rows'] = $this->db->count_all('products');;
        $config['per_page'] = '1';
        $this->pagination->initialize($config);
        
        $query = $this->db->get('products', $config['per_page'], $this->uri->segment(2));
        
        $data['products'] = $query->result_array();
        $data['pagination'] = $this->pagination->create_links();
        $template['title'] = "asdasdasdasdasd";
        $template['description'] = "asdasdasdasdasd";
        $template['keywords'] = "asdasd, asdasd, asdasdasd, asdasd";
        $template['left'] = $this->load->view('left', $data, true);
        $template['content'] = $this->load->view('products', $data, true);
        $this->load->view('container', $template);
    }
....

And in routes i have the following:
Code:
$route['products/:num'] = "products/index";

Its not working at all i get 404 not found error. But when i remove the route and change the products to:
Code:
$config['base_url'] = base_url(). 'products/index/';
and
Code:
$this->uri->segment(2)
al is working fine.

Please tell me whats the problem. I have checked the user guide but nothing on this issue was posted. I have to find a solution on this. Thanks!


  Yet another language question
Posted by: El Forum - 10-20-2007, 01:14 PM - No Replies

[eluser]fancms[/eluser]
I am converting a CMS I wrote to CI and am struggling a bit with how to implement the pre-existing language files I have for it.

Right the language files use a variable $lang_whatever for the various language words/phrases. It seems to work ok if I do a require(/path/to/language/file) within the function within the controller, but this would be very tedious to do throughout every controller and function. In addition, I am wanting the CMS to allow a default site language as well as allowing each user to select their language (which is stored in the database). So I'm not sure simply setting the $config['language'] and having the users upload to /system/application/lang/ is quite what I want to do. I am hoping to keep the CMS-specific language files as close to root level as possible.

I have searched through a lot of pages here and looked through the wiki trying to find an answer and I'm totally stumped. If someone could tell me how to do this or point me in the direction of the answer I would be forever grateful.

Thanks so much Smile


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

Username
  

Password
  





Latest Threads
hot-reload side effects s...
by PaulC
2 hours ago
Changing Session cookie -...
by codeus
4 hours ago
using app/Config/App.php ...
by sam547
Yesterday, 03:04 PM
Setting baseURL in Regist...
by grimpirate
05-15-2025, 02:20 PM
CRUD Code Generator
by DeanE10
05-15-2025, 05:31 AM
CodeIgniter.com - Report ...
by Harry Lyre
05-14-2025, 04:26 AM
Missing closing bracket w...
by abf
05-13-2025, 07:27 PM
Update from 4.6.0 to 4.6....
by FlavioSuar
05-13-2025, 04:17 AM
Sessions old files are de...
by InsiteFX
05-12-2025, 10:30 PM
Ajax post failing with Ty...
by PaulC
05-12-2025, 12:23 AM

Forum Statistics
» Members: 146,521
» Latest member: 88clbjpnet
» Forum threads: 78,392
» Forum posts: 379,463

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB