Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using database functions on query #43

Closed
Surt opened this issue Sep 29, 2011 · 4 comments
Closed

Using database functions on query #43

Surt opened this issue Sep 29, 2011 · 4 comments

Comments

@Surt
Copy link
Contributor

Surt commented Sep 29, 2011

Hi, first, great lib!

I'm triying to set a date field using NOW() in mySQL, is this possible with idiorm?

$content->created = 'NOW()';

does escape and fill the database with wrong data 0000-00-00

@olivierphi
Copy link

+1
This would be a great feature ! (maybe with the use of a dedicated "Expr" class, like Zend_Db_Expr in Zend Framework ?)

@brianherbert
Copy link
Contributor

+1
I'm not sure if this is being considered but I want to throw in my support here.

@robbiesmith79
Copy link

+1
I need support for ifnull() on the column selection but that test is getting wrapped in quotes and MySQL is throwing an error that 'ifnull(..)' is not a valid column. It would be cool if there was a parsing method on all select columns to detect the presence of specific database function name calls to NOT add quotes around them. I guess for now we'll have to use raw queries for the difficult queries.

@dr-impossible
Copy link

For the time being, you could use date('c'). This php function will return a string compatible with TIMESTAMP fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants