pixie icon indicating copy to clipboard operation
pixie copied to clipboard

insertedid is not working

Open billionri opened this issue 8 years ago • 5 comments

Inside readme in Insert section :- $data = array( 'name' => 'Sana', 'description' => 'Blah' );

$insertId = QB::table('my_table')->insert($data); echo $insertId ;

Output: ""

billionri avatar Feb 17 '17 12:02 billionri

@rash039 can you post your table structure. Also what PHP version are you running?

TCB13 avatar Jun 29 '17 10:06 TCB13

@TCB13 PHP version:

PHP 5.3.8 (cli) 
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

Database: PostgreSQL Version: psql (PostgreSQL) 9.3.6

Table structure:

CREATE TABLE ayushakti_patients_therapists_list (
  id  BIGSERIAL PRIMARY KEY,        
  name VARCHAR(100) NOT NULL,
  msisdn BIGINT NOT NULL, 
  custid integer, 
  therpistids VARCHAR(255), 
  feedback VARCHAR(255), 
  feedback_time timestamp without time zone, 
  timestamp timestamp without time zone default now()
);
CREATE INDEX ayushakti_patients_therapists_list_index ON ayushakti_patients_therapists_list(Id) ;

billionri avatar Jul 01 '17 05:07 billionri

@rash039 I can't confirm this but this is probably a bug with your old php version / database. In modern versions with mysql it is working properly.

TCB13 avatar Jul 04 '17 11:07 TCB13

@rash039 can you test the fix in #147 ?

TCB13 avatar Oct 20 '17 10:10 TCB13

@TCB13

Still getting Uncaught PDOException: SQLSTATE[55000]: Object not in prerequisite state: 7 ERROR: lastval is not yet defined in this session with with latest master in PSQL 10.4.

Can anyone confirm this ?

Are there any possible solutions for this issue ?

aherle avatar Sep 12 '18 05:09 aherle