Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
ORM with related limit at wrong place?
That is by design, and documented. This is because it's a get_one, with relations. Say you have 1 parent, and 5 children. The ORM will fetch them all, so you'll end up with one Model_Parent object (since you asked for one), and all five M…
Comment by
WanWizard
April 2014
permalink
Multiple database connections
In your controller, before you access the db, do \Config::load('db', true); \Debug::dump(\Config::get('db')); What is the output? Is it what you think it is?
Comment by
WanWizard
April 2014
permalink
db.php with a DB configured but saving in another
For ORM (and Model_Crud), you can define the database connection to use in the model (it's a property). You can even specify different databases for read and write. For Auth, these are defined in the auth config files (you need 1.8/develop fo…
Comment by
WanWizard
April 2014
permalink
db.php with a DB configured but saving in another
A config file is loaded only once, in the case of the database on the first DB call. After that it works from the loaded config in memory, it will not access the file anymore. Also, once an instance is created, it exists and it will be re-used, so …
Comment by
WanWizard
April 2014
permalink
Is there a way to insert data in a migration?
Also possible, I tend not to do that if it's not needed, for performance reasons.
Comment by
WanWizard
April 2014
permalink
Switched from XAMPP to AMMPS - Uncaught exception 'PDOException' with message 'invalid data source'
interesting article about short tags: http://programmers.stackexchange.com/questions/151661/is-it-bad-practice-to-use-tag-in-php
Comment by
WanWizard
April 2014
permalink
Switched from XAMPP to AMMPS - Uncaught exception 'PDOException' with message 'invalid data source'
Ok. So that isn't the problem. Your db config looks ok, it's not a rights issue that prevents the config file from being found? I assume the new stack uses a different user to run?
Comment by
WanWizard
April 2014
permalink
Switched from XAMPP to AMMPS - Uncaught exception 'PDOException' with message 'invalid data source'
Check if the php binary in your stack uses the php.ini file you think it uses. Several of these stacks have non-standard apache/php setups, causing the wrong ini file being used, with the result that for example the pdo_mysql.so extension is not lo…
Comment by
WanWizard
April 2014
permalink
Multiple database connections
Is you db.php configuration correct? You say you added this to your app/config.php, which is the global database config. If a db.php also exists in your enviroment config folder (where this should be added), that file will overwrite the global one, …
Comment by
WanWizard
April 2014
permalink
trouble when installing FuelPHP 1.7.1 on remote server
It seems that your environment has the suEXEC mechanism enabled for PHP scripts. Try setting the folder permission to 755 and file permission to 644.
Comment by
WanWizard
April 2014
permalink
PDO database connection error: SQLSTATE[08006] [7]
I said Postgres because your error message said "on port 5432", which is the Postgres port. If you want to use MySQL, your PDO DSN is not correct.
Comment by
WanWizard
April 2014
permalink
Use single quotes for attributes set with Fieldset::forge('foobar')->add() ?
You mean you're trying to put a string into an HTML tag attribute that contains a double quote? The correct way to deal with that is to html-encode the string. Obviously that means that the code using that data attribute must know that and htm…
Comment by
WanWizard
April 2014
permalink
ORM with related limit at wrong place?
This is documented and by design. ORM will always try to return complete resultsets based on the query you construct. In this case you're asking for "account_level" with account_id 2 and all it's groups (because you do a get()).…
Comment by
WanWizard
April 2014
permalink
PDO database connection error: SQLSTATE[08006] [7]
Assuming Postgres is running on localhost and listening to that port, are your credentials ok?
Comment by
WanWizard
April 2014
permalink
[OFF TOPIC] Suggestion about graph library?
I've checked here (I'm not a frontend man myself), we use http://omnipotent.net/jquery.sparkline/#s-about
Comment by
WanWizard
April 2014
permalink
[OFF TOPIC] Suggestion about graph library?
php? javascript? something else? And what type of graph?
Comment by
WanWizard
April 2014
permalink
Storing serialised objects in the DB
Fuel's DB layer is originally kohana's, so i'm not sure what we do different. I checked the code of the drivers we have, but the MySQL drivers uses mysql_real_escape_string(), the MySQLi driver uses the real_escape_string() method, a…
Comment by
WanWizard
April 2014
permalink
Error in Pagination Documentation
When you have cases like this, always check http://www.fuelphp.com/dev-docs/classes/pagination.html to see if the error has already been corrected. In this case, it is, release docs will be updated with the next release, 1.7.2. due any day.
Comment by
WanWizard
April 2014
permalink
Paginator url building is wrong
Can you post an example of your code that produced that output? And the version of Fuel you tested it with?
Comment by
WanWizard
April 2014
permalink
Is there a way to insert data in a migration?
It depends on your situation? How much data? Where is it coming from? It could be as simple as:
Comment by
WanWizard
April 2014
permalink
Is there a way to insert data in a migration?
You don't want to know what we all do in a migration. Everything but make coffee! :-) Altough often suggested, migrations are not solely for database schema changes. Everything needed to migrate an application from version A to version B can b…
Comment by
WanWizard
April 2014
permalink
Best way to automatically populate my model.
Why not? class Blah extends \Orm\Model { public function __construct(array $data = array(), $new = true, $view = null, $cache = true) { // do your thing befor constructing parent::__construct($data, $new, $view, $cache); …
Comment by
WanWizard
April 2014
permalink
Working with dates and Oracle
Encapsulate it into a DB::expr().
Comment by
WanWizard
April 2014
permalink
Problem with plural and legacy system.
No problem. You don't say what you generate, but both Model_Crud and ORM allow you to define the tablename by hand using a property. Just generate the code, and then add/update the property manually.
Comment by
WanWizard
April 2014
permalink
Best way to automatically populate my model.
_data isn't static, it's the data container present in any model object. Which means it can't be populated from _init(). Observers also only act on object instances.
Comment by
WanWizard
April 2014
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,368
Last Active
7:53AM
Roles
Administrator