Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
How to pass Date-Function via SQL-Mapper in fat-free-framwork?

I am using fat-free-framwork to edit my user-table and try to update a date-field with:

$user = new DB\SQL\Mapper($db,TBL_USER);
$user->load('userID = 12');
$user->username = 'newUsername';
$user->datChanged = 'NOW()';
&user->update();

It changes the field 'username' proper but wont change the datetime-field 'datChanged' as the mapper puts the NOW() into quotes.

Any idea how to call the date-functions in the mapper?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It's not possible at the moment, because the mapper heavily uses prepared statements and you cannot bind functions to placeholders, because the underlaying PDO engine is stringifying these within the query preparation.

You could use this instead:

$user->datChaned = date('Y-m-d H:i:s');
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!