Your application can then perform the correct action. CodeIgniter has a config file that lets you store your database connection values username, password, database name, etc. It solved my problem. The reason you have to put the database path in the hostname field is the way CI instantiates the PDO object:. A default table prefix that should be swapped with dbprefix. Return number of rows that were deleted: An optional table prefix which will added to the table name when running Query Builder queries.

Uploader: Gugrel
Date Added: 27 September 2014
File Size: 37.98 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 28911
Price: Free* [*Free Regsitration Required]

PHP: PDOStatement::rowCount – Manual

The default setting is TRUE. That looks like the Ci2 database lay out codeigniter. Notify me of new comments via email. Fill in your details below or click an icon to log in: The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store multiple sets of connection values.

As of SQLite codeignkter.

These failovers can be specified by setting the failover for a connection like this:. Why does the syntax differ when conecting to a SQLite 3 database?

Using CodeIgniter 2 with SQLite 3 databases | Living with technology

Sign up or log in Sign up using Google. This site uses cookies. If you do not specify a DSN string for codeighiter driver that requires it, CodeIgniter will try to build it with the rest of the provided settings. The reason you have to put the database path in the hostname field is the way CI instantiates the PDO object:.


You can also specify failovers for the situation when the main connection cannot connect for some reason. Stanislav, thank you for this! Return Values Returns the number of rows.

If more than one row responds to the SELECT query, the query returns still only one row and you don’t know which one exactly. SQLite3 in CodeIgniter 3. Return number of rows that were deleted: Description public int PDOStatement:: Email Required, but never shown.

For example, when using SQLite you will not need to supply a username or password, and the database name will be the path codeignuter your database file. You are commenting using your Facebook account. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user. I’m not so sure I’m diggin’ PDO yet.

In local, the rowCount is not giving the correct number of rows but it is working fine when uploaded to our hosting site. If, for example, you run multiple environments development, production, test, etc. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued codeitniter of the website is pso to these policies.


For most databases, PDOStatement:: Then, to globally tell the system to use that group you would set this variable located in the config file:. If you provide a DSN string and it is missing some valid settings e.


Thank you for this. To display information only when the query is not empty, I do something like this: Note If you provide a DSN string and it is missing some valid settings e.

If you are not using the query builder class, setting it to FALSE will utilize fewer resources when the database classes are initialized. The fetchColumn is working fine in local but not anymore when uploaded.