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
Setting a value for PK
Pushed an update to 1.9/develop. You can now add protected static $block_set_pks = false; to your models and set PK values through forge() and from_array().
Comment by
WanWizard
June 2018
permalink
Setting a value for PK
If you can wait a few hours, I can see what I can do and save you a lot of work. ;-)
Comment by
WanWizard
June 2018
permalink
Setting a value for PK
I'm sure you're right. I've never bumped into this situation myself, but I understand this is annoying for you. I think people using databases without auto-increment, like PostgreSQL, have the same issue. I need to have a think about…
Comment by
WanWizard
June 2018
permalink
Setting a value for PK
This is by design, it is to prevent creating an ORM object in "new" state with a valid and already existing PK, which will cause an exception when you want to save the object. Instead, use $order = Model_Order::forge()->from_array($val…
Comment by
WanWizard
May 2018
permalink
Does Fuel still use phpseclib besides for legacy (en/de)cryption in Fuel v1.8.1+?
Yes, it is much more secure, the old Crypt encryption could be broken with sufficient GPU power. And in PHP 7.2+, Sodium support it is built-in.
Comment by
WanWizard
May 2018
permalink
Does Fuel still use phpseclib besides for legacy (en/de)cryption in Fuel v1.8.1+?
Correct.
Comment by
WanWizard
May 2018
permalink
Field with data type TIME
I've pushed an update to the ORM package for Observer_Typing, with support for the database column types DATE, TIME and DATETIME. Let me know if this fixes your problem.
Comment by
WanWizard
May 2018
permalink
Field with data type TIME
The problem is that you haven't defined your properties in the model, so the ORM tries to determine them by requesting column data from your database. And for some reason the ORM sees your "time" column as datetime, upon which the Typ…
Comment by
WanWizard
May 2018
permalink
Problem with float values
Think I fixed it. $val = 0.000398036536274371421812;$query = DB::insert('test', array('value'))->values($val))->execute(); stores 0.000398037 in a MySQL column defined as "float" without any decimals. The ORM has …
Comment by
WanWizard
May 2018
permalink
Problem with float values
Problem found. The DBAL does a sprintf("%F", $val) to convert the float into a locale-agnostic float, as PHP uses decimal comma's in some locale's which most databases don't like. And for some reason that truncates. Next up:…
Comment by
WanWizard
May 2018
permalink
Field with data type TIME
How can a timestamp be a string with "05:00:00:? A timestamp is a number...
Comment by
WanWizard
May 2018
permalink
Problem with float values
I'll have a look later today. This is a normal DB::insert(), or is this an ORM insert?
Comment by
WanWizard
May 2018
permalink
Problem with float values
What does the SQL in the profiler show you?
Comment by
WanWizard
May 2018
permalink
Problem with float values
Enable the profiler in the config, and enable database profiling in your db config, and check what SQL is exactly generation. Then at least you'll know if it is a Fuel issue or a MySQL issue. I personally try to avoid floats at all costs, as fl…
Comment by
WanWizard
May 2018
permalink
Problem with float values
How did you define the database column? Are you using Observer_Typing with defined decimals of float format on the field in the model?
Comment by
WanWizard
May 2018
permalink
DB::count_last_query() throws an error
And also fixed.
Comment by
WanWizard
May 2018
permalink
DB::count_last_query() throws an error
Found another issue, so more updates are coming...
Comment by
WanWizard
May 2018
permalink
DB::count_last_query() throws an error
Fixed. Also count_last_query() no longer resets the "last query" in the system, so the expected behaviour is now also a more logical behaviour. ;-)
Comment by
WanWizard
May 2018
permalink
DB::count_last_query() throws an error
I have to look at it.
Comment by
WanWizard
May 2018
permalink
DB::count_last_query() throws an error
That is expected behaviour, the DBAL doesn't know where queries come from, it just uses the last one.
Comment by
WanWizard
May 2018
permalink
\Session_Db: db object stored in variable causing issue
Thanks for the feedback. I'll merge it as an 1.8.1 hotfix tomorrow.
Comment by
WanWizard
May 2018
permalink
\Session_Db: db object stored in variable causing issue
Think I've found it. Can you update your fuel/core and check again?
Comment by
WanWizard
May 2018
permalink
\Session_Db: db object stored in variable causing issue
Weird, as I wrote, I can not reproduce it with your code as posted on the 18th. edit: I just noticed that I have "enable_cache" set to true, maybe that may play a part, I will do some further digging tonight.
Comment by
WanWizard
May 2018
permalink
\Session_Db: db object stored in variable causing issue
Other then I would use "mysql" instead of "PDO" (so Fuel knows to generate MySQL SQL instead of ANSI SQL) I don't see anything weird. What version of Fuel are you on?
Comment by
WanWizard
May 2018
permalink
\Session_Db: db object stored in variable causing issue
I can't reproduce it, with that exact snippet:/data/www/19develop/fuel/app/classes/controller/db.php:12:string '1' (length=1) /data/www/19develop/fuel/app/classes/controller/db.php:15:string '1' (length=1)
Comment by
WanWizard
May 2018
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,366
Last Active
11:56AM
Roles
Administrator