Fixed: Custom Controller. Insert Sometimes Works
Permalink<?php Loader::model('concert'); class DashboardBoxOfficeController extends Controller { public function on_start() { $concert = new Concert(); $concert->concertName = 'Nitty Gritty Dirt Band'; $concert->ticketPurchaseLimit = 10; $concert->onSaleDate = date('Y-m-d h:i:s', time()); $concert->concertDate = date('Y-m-d', time()); $concert->save(); } }
One minute it'll insert a new record and the next it'll throw this error: mysql error: [-9999: Input Array does not match ?: INSERT INTO Concerts(concertId,concertName,ticketPurchaseLimit,onSaleDate,concertDate) VALUES (] in Execute(, )
Any help would be greatly appreciated.
I needed to explicitly set the primary key field to null. BRUTES AdoDBActiveRecord, BRUTES I say!