Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

insertedid is not working #160

Open
billionri opened this issue Feb 17, 2017 · 5 comments
Open

insertedid is not working #160

billionri opened this issue Feb 17, 2017 · 5 comments

Comments

@billionri
Copy link

billionri commented Feb 17, 2017

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

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

Output:
""

@TCB13
Copy link

TCB13 commented Jun 29, 2017

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

@billionri
Copy link
Author

billionri commented Jul 1, 2017

@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) ;

@TCB13
Copy link

TCB13 commented Jul 4, 2017

@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
Copy link

TCB13 commented Oct 20, 2017

@rash039 can you test the fix in #147 ?

@aherle
Copy link

aherle commented Sep 12, 2018

@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 ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants