Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel\Core\Database_Exception [ Error ]: Column not found
  • I'm pretty new to this and it's still confusing but i understand the basics. Anyhow i get the following error:

    Fuel\Core\Database_Exception [ Error ]: SQLSTATE[42S22]: Column not
    found: 1054 Unknown column 't0.created_at' in 'field list' with query:
    "SELECT `t0`.`id` AS `t0_c0`, `t0`.`name` AS `t0_c1`, `t0`.`image` AS
    `t0_c2`, `t0`.`value` AS `t0_c3`, `t0`.`desc` AS `t0_c4`,
    `t0`.`ticket_value` AS `t0_c5`, `t0`.`created_at` AS `t0_c6` FROM
    `items` AS `t0` WHERE `t0`.`id` = 1 LIMIT 1"


    My table structure is as follows:

    Items
    --->id

    Tickets
    --->id
    --->blink_id
    --->user_id

    Blinks
    --->id
    --->item_id

    Here is my code http://pastie.org/6263066

    Items table is already populated with diffirent items. Error seems to be caused by this line: $blink->item = Model_Item::find(1);

    How do i go about solving this. Also my question is do i really need item_id in my Blinks table if i defined $_has_one relation.
  • Looks like you have 'created_at' in your $_properties list. That list MUST match the columns in your table.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion