Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:05:39+00:00 2026-06-10T23:05:39+00:00

Here is my database schema for my MySQL database: create table noticia ( id

  • 0

Here is my database schema for my MySQL database:

create table noticia 
(
    id int,
    imagen varchar(255),
    fecha datetime,
    titulo varchar(255),
    url varchar(255),
    descripcion varchar(255),
    contenido text
) 

I’m using RedBeanPHP as my ORM to save the information to a database. Here is where I’m scraping and parsing the dates to a DateTime object as per the documentation.

foreach ($element->find('span.fechanoticia') as $fecha) {
   $tmp = str_replace("/", "-", $fecha->innertext);
   print_r($tmp);

   $dateFoo = new DateTime($tmp);
   echo $dateFoo->format('Y-m-d H:i:s');

   $newItem->set_fechanoticia($dateFoo);
}

The $tmp variable this value for example:

05-09-2012

The echo call to format returns:

2012-09-05 00:00:00

Everything is peachy, and working.

However when I try to save it to the database using RedBeanPHP I get this error:

Fatal error: Uncaught exception ‘RedBean_Exception_Security’ with
message ‘Invalid Bean: property fecha ‘ in
C:\xampp\htdocs\blog-uvm\rb.php:4880 Stack trace: #0
C:\xampp\htdocs\blog-uvm\rb.php(5108):
RedBean_OODB->check(Object(RedBean_OODBBean)) #1
C:\xampp\htdocs\blog-uvm\rb.php(5082):
RedBean_OODB->storeBean(Object(RedBean_OODBBean)) #2
C:\xampp\htdocs\blog-uvm\rb.php(7005):
RedBean_OODB->store(Object(RedBean_OODBBean)) #3
C:\xampp\htdocs\blog-uvm\index.php(60):
RedBean_Facade::store(Object(RedBean_OODBBean)) #4 {main} thrown in
C:\xampp\htdocs\blog-uvm\rb.php on line 4880

Can RedBeanPHP not handle datetime objects?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:05:41+00:00Added an answer on June 10, 2026 at 11:05 pm

    As per RedBean’s documentation (More data types), you can only save DateTime objects if they are in string form.

    For example:

    // It's a string - not a DateTime.
    $photo->created = '1995-12-05 19:00:00';
    

    In this case the solution should be to save the formatted string, not the DateTime object itself:

    $newItem->set_fechanoticia($dateFoo->format('Y-m-d H:i:s'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Mysql datatbase, and working on servlet: this is my Table schema: CREATE
Just getting into SQL stored queries right now... anyway, here's my database schema (simplified
The Media Wiki database Schema, here , has taught me a lot. Cannot-understand: In
Here is my current setup: Database Role - MyDbRole Schema - MySchema User -
I have to create a database with two tables in MySQL, but the script
I have a database schema (MySql) exposed as a data/OData service that is queried
I want to insert data in MYSQL database using python here my code import
Trying to update the production mysql database by doing: rvmsudo RAILS_ENV=production rake db:schema:load on
Here is my database schema: user *user_id *username *password *etc quiz_response *response_id *user_id *question_id
We have an Oracle database here that's been around for about 10 years. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.