An SQL error occurred: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'date' in 'field list'

An SQL error occurred: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'date' in 'field list'

visda04visda04 Posts: 1Questions: 1Answers: 0

I am attempting to retrieve data from my database for the first time. I receive this message.

An SQL error occurred: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'date' in 'field list'

I don't understand where "date" is in the field list.

Any assistance will be much appreciated...

Here is my code (table.ProductionData.php):

`<?php

/*
* Editor server script for DB table ProductionData
* Created by http://editor.datatables.net/generator
*/

// DataTables PHP library and database connection
include( "lib/DataTables.php" );

// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;

// The following statement can be removed after the first run (i.e. the database
// table has been created). It is a good idea to do this to help improve
// performance.
$db->sql( "CREATE TABLE IF NOT EXISTS ProductionData (
id int(10) NOT NULL auto_increment,
apinum varchar(255),
productiondate varchar(255),
oilproduced varchar(255),
waterproduced varchar(255),
gasproduced varchar(255),
dayswellproduced varchar(255),
gravityofoil varchar(255),
casingpressure varchar(255),
tubingpressure varchar(255),
btu varchar(255),
methodofoperation varchar(255),
waterdisposition varchar(255),
pwtstatus varchar(255),
welltype varchar(255),
status varchar(255),
poolcode varchar(255),
reporteddate varchar(255),
PRIMARY KEY( id )
);" );

// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'ProductionData', 'id' )
->fields(
Field::inst( 'apinum' ),
Field::inst( 'productiondate' ),
Field::inst( 'oilproduced' ),
Field::inst( 'waterproduced' ),
Field::inst( 'gasproduced' ),
Field::inst( 'dayswellproduced' ),
Field::inst( 'gravityofoil' ),
Field::inst( 'casingpressure' ),
Field::inst( 'tubingpressure' ),
Field::inst( 'btu' ),
Field::inst( 'methodofoperation' ),
Field::inst( 'waterdisposition' ),
Field::inst( 'pwtstatus' ),
Field::inst( 'welltype' ),
Field::inst( 'status' ),
Field::inst( 'poolcode' ),
Field::inst( 'reporteddate' )
)
->process( $_POST )
->json();
`

This discussion has been closed.