-
Notifications
You must be signed in to change notification settings - Fork 26
[b][color=green]Table of Contents[/color][/b] [color=grey][i](Absent an automagic ToC feature in the CI-wiki, this is here for convenience only. Do NOT assume all the FAQs on this page are listed in this table of contents -- please read through this whole page, just in case. Ctrl-F is your friend ;)[/i][/color]
[b]Database[/b]
- [i]For SQL-specific questions, check in the [url="/wiki/SQL"]SQL FAQ[/url] too[/i]
- [i]How do I see the actual raw SQL query generated by CI's Active Record[/i]
- [i]How do I find out the ID of the row I just inserted?[/i]
- [i]How do I do a COUNT('foo') using the Active Record functions?[/i]
- [i]Can I extend the core Database class?[/i]
- [i]Oracle does weird things[/i]
[b]Design[/b]
- [i]I keep repeating lumps of code - things like login-dialogs, stylesheets, headers, footers, or menus - is there some place I can define them just once?[/i]
- [i]How do I embed views within views? Nested templates? Header, Main, Footer (Blocks) design? Partials? Page Fragments? Ruby on Rails style Yield functionality?[/i]
- [i]How do I pass parameters to a controller's index() function?[/i]
- [i]How do I call one Controller's methods from a different Controller?[/i]
[b]Errors[/b]
- [i]Headers already sent[/i]
[b]Forms and Input and POST data[/b]
- [i]Is there a way to get [/i]all[i] the $this->input->post() items?[/i]
[b]JavaScript and AJAX and JS libraries[/b]
- [i]I'm confused[/i]
[b]Site migrations, relocations and platform differences[/b]
- [i]After moving from development to production, my site stopped working[/i]
- [i]How do I migrate my existing 'normal' PHP site to CodeIgniter?[/i]
[b]CodeIgniter and EllisLab and ExpressionEngine[/b]
- [i]When is the next version of CodeIgniter coming out? What can I expect from the next version of CodeIgniter?[/i]
- [i]I've got cool new code for CI. What is the process for getting it included in the official CI distribution?[/i]
[b]Plain old frequently asked questions[/b]
- [i]How do I find the name of the current controller and/or method?[/i]
- [i]Can I cache only certain parts of a page? [/i]
- [i]How do I call methods in one controller via another controller?[/i]
[h2]Database[/h2]
[i]Checking under the hood of queries, that kind of thing[/i]
[color=purple][b]===>[/b] Be sure to also check the [url="/wiki/SQL"]SQL FAQ page[/url]. [b]<===[/b][/color]
[h3]How do I see the actual raw SQL query generated by CI's Active Record[/h3]
[b]Answer 1[/b] Turn on [url="http://codeigniter.com/user_guide/general/profiling.html"]profiling[/url] (part of the benchmarking class) - this will show the full detail of all the SQL queries for the page.
[b]Answer 2[/b] You can do this before your query: [code] $this->db->_compile_select(); [/code] .. and then this, once you've run the query: [code] $this->db->last_query(); [/code]
[h3]How do I find out the ID of the row I just inserted?[/h3] [i][color=grey](Just so that people searching for this will be more likely to find it, we'll mention that this is comparable to the native PHP mysql_insert_id() function.)[/color][/i]
This is covered in the [url="http://codeigniter.com%2