From c644128fdd49a47d791240e0e38b54cd22412bc5 Mon Sep 17 00:00:00 2001
From: Derek Allard Lets you limit the number of rows you would like returned by the query:
+ Lets you limit the number of rows you would like returned by the query: The first parameter is the table name, the second is the where clause. You can also use the where() or orwhere() functions instead of passing
-the data to the second parameter of the function:
+the data to the second parameter of the function:
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc. CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.).
-The config file is located at:
+The config file is located at: application/config/database.php
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc. For information on each of these values please see the configuration page.
+ For information on each of these values please see the configuration page. Or you can submit your database values as a Data Source Name. DSNs must have this prototype:
+ Or you can submit your database values as a Data Source Name. DSNs must have this prototype: Note that if you use a DSN you will not be able to specify some of the default values like you can if you use a connection array. If you need to connect to more than one database simultaneously you can do so as follows:
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
+ CodeIgniter · Copyright © 2007 · Ellislab, Inc.
$this->db->limit(10);
@@ -565,7 +565,7 @@ $this->db->delete('mytable', array('id' => $id));
// WHERE id = $id
$this->db->where('id', $id);
-
@@ -603,7 +603,7 @@ Previous Topic: Query Helper Functions
Top of Page ·
User Guide Home ·
Next Topic: Transactions
-Database Configuration
$this->load->database($config);$dsn = 'dbdriver://username:password@hostname/database';
@@ -122,8 +122,6 @@ $this->load->database('$dsn');Connecting to Multiple Databases
$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
+$sql = "INSERT INTO table (title) VALUES(".$this->db->escape($title).")";
$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
-
-$sql = "INSERT INTO table (title) VALUES('".$this->db->escape_str($title)."')";
@@ -134,7 +132,7 @@ Previous Topic: Connecting to your Database
Top of Page ·
User Guide Home ·
Next Topic: Query Results
-+
CodeIgniter · Copyright © 2007 · Ellislab, Inc.
diff --git a/user_guide/database/results.html b/user_guide/database/results.html index 5b25015bf..f6c1be124 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -134,7 +134,7 @@ Query Results } -If you want a specific row returned you can submit the row number as a digit in the first parameter: +
If you want a specific row returned you can submit the row number as a digit in the first parameter:
$row = $query->row(5);
@@ -157,7 +157,7 @@ Query Results
- If you want a specific row returned you can submit the row number as a digit in the first parameter: +
If you want a specific row returned you can submit the row number as a digit in the first parameter:
$row = $query->row_array(5);
@@ -181,7 +181,7 @@ Query Results
-+
CodeIgniter · Copyright © 2007 · Ellislab, Inc.
diff --git a/user_guide/database/table_data.html b/user_guide/database/table_data.html index 6792e356f..13b96681a 100644 --- a/user_guide/database/table_data.html +++ b/user_guide/database/table_data.html @@ -110,7 +110,7 @@ Previous Topic: Transactions Top of Page · User Guide Home · Next Topic: Field Metadata -+
CodeIgniter · Copyright © 2007 · Ellislab, Inc.
diff --git a/user_guide/database/transactions.html b/user_guide/database/transactions.html index ecc5164d3..75aa4e887 100644 --- a/user_guide/database/transactions.html +++ b/user_guide/database/transactions.html @@ -122,7 +122,7 @@ if ($this->db->trans_status() === FALSE)Transactions are enabled automatically the moment you use $this->db->trans_start(). If you would like to disable transactions you -can do so using $this->db->trans_off(): +can do so using $this->db->trans_off():
$this->db->trans_off()
@@ -138,7 +138,7 @@ $this->db->trans_complete();
Test Mode
You can optionally put the transaction system into "test mode", which will cause your queries to be rolled back -- even if the queries produce a valid result.
-To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE:
+To use test mode simply set the first parameter in the $this->db->trans_start() function to TRUE:
$this->db->trans_start(TRUE); // Query will be rolled back
@@ -190,7 +190,7 @@ Previous Topic: Field MetaData
Top of Page ·
User Guide Home ·
Next Topic: Table Metadata
-
+
CodeIgniter · Copyright © 2007 · Ellislab, Inc.
diff --git a/user_guide/database/utilities.html b/user_guide/database/utilities.html
index a7601e85f..7de0ea3ed 100644
--- a/user_guide/database/utilities.html
+++ b/user_guide/database/utilities.html
@@ -205,7 +205,7 @@ echo $this->dbutil->csv_from_result($query);
The second and third parameters allows you to
-set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:
+set the delimiter and newline character. By default tabs are used as the delimiter and "\n" is used as a new line. Example:
$delimiter = ",";
@@ -330,7 +330,7 @@ Previous Topic: DB Caching Class
Top of Page ·
User Guide Home ·
Next Topic: Email Class
-
+
CodeIgniter · Copyright © 2007 · Ellislab, Inc.
--
cgit v1.2.3-24-g4f1b