Problem with database in CodeIgniter - database

I downloaded the last version of CodeIgniter and I tried to run a simple app. The code works perfectly without database, but when I added this
$autoload['libraries'] = array('database');
the page went to blank.
I looked at the logs files but I didn't find anything, I check differents tutorial, but my database.php file looks correctly configured. I removed it from the array.
$autoload['libraries'] = array('');
and added to the controller this:
$this->load->library('database');
Then, this error appeared
An Error was encountered
Unable to load the requested class: database
What I do? Any clue?
Thanks in advance

To autoload the database, you use $autoload['libraries'].
$autoload['libraries'] = array('database')
Or, to load it manually, you use:
$this->load->database();
The database driver is not a normal library, it follows some weird rules.

To use the database you need to use the 'library' autoload instead of the 'config' auto load
$autoload['libraries'] = array('database');
This will actually automatically load up your configurations.
UPDATE
Another thing you mention in your question is that you 'add' that line, you do not need to add that line, you are suppose to add the element to the array that already exists on that line. You potentially could be overwriting other autoloaded libraries, I will need to see your autoload.php file to confirm this.

Related

How to migrate an online angular script to local server?

Hi I'm trying to make an offline version of this page:
https://u-he.com/tools/microtuning/ the script is writtin with Angular JS how do I do that?
I saved the page control-s and copied the file to the local server I'm running.
And then I browsed the local ip. the page opened but I get repeated notes ng-repeat shows up as multiple boxes instead of 1 box that edits the same note but in different octaves.
How do I solve this problem please.
You can inspect the front-end code in your browser console. In Firefox it's in the section called "Debugger", in Chrome it's called "Sources". If you use Safari, you need to enable Developer mode first.
Once you have the appropriate view, just click on u-he.com -> tools/microtuning/ -> index
Hopefully it goes without saying that you shouldn't use large swaths of another person's code without at least giving appropriate credit, or better yet getting the developer's permission, unless there is an explicit open-source license.

Watson document conversion not working for my downloaded pdf files

i tried following the steps mentioned "https://github.com/watson-developer-cloud/document-conversion-nodejs" and is able to load the app which works well with sample pdf file.
But when i try using my pdf file it throws error "Missing required parameters:
either params.file or params.document_id must be specified"
Also in the above mentioned git hub link the step 7 is not clear, it mentions run node setup.js but i am not able to find out that file.
has anybody faced this kind of issue.Kindly reply.
Thanks for pointing out the confusing step 7 in the document-conversion-nodejs repo. That's not a valid step and I've submitted a pull request to remove it.
You should be able to change the sample files with your own, if this is what you are trying to do. I would need to see some of your code to maybe figure out what is going on with it.
There is an alternative repository [watson-developer-cloud/node-sdk] that you also can use to create your NodeJS application. It also has an example (examples/document_conversion.v1.js) on how to run the service.
Besides entering your service credentials, all you need to do is place the document you want to convert in the "resources" folder and point to it in this line:
fs.createReadStream(__dirname + '/resources/YOUR_DOCUMENT')
The tutorial and the API documentation could also be of help.

Default values automatically save in database when plugin will be activated

I have used a WordPress Settings API PHP Class framework, that found here http://tareq.wedevs.com/2012/06/wordpress-settings-api-php-class/, to create my first plugin setting page.
Everything is working fine except default option values are not saving in database until I hit "Save" going to setting page. But I would like this to be saved automatically when someone activate the plugin.
I tried using register_activation_hook() but failed. I am not sure how to use that framework with register_activation_hook(). You can check the codes going to the link I mentioned above. I am about to finish my first plugin but stuck on this.

Error after installing CakePhp in Production setup

guys could somebody please help me out? I have just installed cakephp in my localhost
then I'm already getting errors.
Please check this out for reference screenshot of entire page
There may be a table exist namely 'reservations' in your database for which code is not exist.
Sp please create ReservationController.php in Controller folder as well as its Model in 'Model' Folder.
If you want to access any methods of the RestrictionController you have to create view files accordingly.

Error after adding ADO.NET Entity Data Model to WPF Browser App

I am creating a WPF Browser App in which I need to be able to access and insert data into a SQL Server table. Before adding the data source, the program builds and runs just fine. After using the wizard to add the ADO.NET Entity Data Model component, I try to build it and get the error
Error 2 The type name 'App' does not exist in the type 'ServiceRequest.ServiceRequest' C:\Projects\WPF\ServiceRequest\ServiceRequest\obj\Debug\App.g.cs 60 28 ServiceRequest
I even tried creating a new WPF Browser App, adding only the data source and nothing else, and get the same error. I looked at the app.g.cs file before and after adding the data source, and they are identical. How could this be causing an error when nothing has changed?
Thank you for any help.
UPDATE:
Found that if I only include a stored procedure rather than only including a table, I do not get any errors.
I was able to determine that I got the error because my project and the table I was adding had the same name. Changing the name of my project fixed it.

Resources