Error: insert failed

anonymous wrote on Sunday, February 19, 2012:

Hello!

I’ve just installed the OpenEMR on Hostgator VPS. 

However, i have not been able to add new patient or facilities.  The error message is like this: 

ERROR: insert failed: INSERT INTO patient_data SET pid = ‘1’, date = NOW(), `title` = ‘’, `fname` = ‘Steve’, `mname` = ‘’, `lname` = ‘Jobs’, `pubpid` = ‘1’, `DOB` = ‘1950-01-01’, `sex` = ‘Male’, `ss` = ‘’, `drivers_license` = ‘’, `status` = ‘’, `genericname1` = ‘’, `genericval1` = ‘’, `genericname2` = ‘’, `genericval2` = ‘’, `street` = ‘’, `city` = ‘’, `state` = ‘’, `postal_code` = ‘’, `country_code` = ‘’, `mothersname` = ‘’, `guardiansname` = ‘’, `contact_relationship` = ‘’, `phone_contact` = ‘’, `phone_home` = ‘’, `phone_biz` = ‘’, `phone_cell` = ‘’, `email` = ‘’, `providerID` = ‘’, `pharmacy_id` = ‘0’, `hipaa_notice` = ‘’, `hipaa_voice` = ‘’, `hipaa_message` = ‘’, `hipaa_mail` = ‘’, `hipaa_allowsms` = ‘’, `hipaa_allowemail` = ‘’, `allow_imm_reg_use` = ‘’, `allow_imm_info_share` = ‘’, `allow_health_info_ex` = ‘’, `allow_patient_portal` = ‘’, `occupation` = ‘’, `language` = ‘’, `ethnicity` = ‘’, `race` = ‘’, `financial_review` = ‘’, `family_size` = ‘’, `monthly_income` = ‘’, `homeless` = ‘’, `interpretter` = ‘’, `migrantseasonal` = ‘’, `referral_source` = ‘’, `vfc` = ‘’, `deceased_date` = ‘’, `deceased_reason` = ’

Could someone enlighten me with this Add Patient / Facilities problem?

Thanks a lot.

bradymiller wrote on Thursday, February 23, 2012:

Hi,

Need to ensure the server has correct php settings:
http://www.open-emr.org/wiki/index.php/FAQ#What_are_the_correct_PHP_settings_.28can_be_found_in_the_php.ini_file.29_.3F

Also, make sure mysql’s configuration make sure the STRICT_MODE is disabled

-brady

ardenwong wrote on Friday, February 24, 2012:

Thanks Brady.  Making some progress.  I can add facilities now.  But still adding patients get this error: 

ERROR: insert failed: insert into history_data set pid = ?, date = NOW()

Error: Table ‘ardenw_openemr2.history_data’ doesn’t exist

How should I proceed?

bradymiller wrote on Saturday, February 25, 2012:

Hi,

You seem to be missing tables (ie. history_data table does not exist). Paste here what the sql-mode setting is for the mysql configuration (guessing you may need to reinstall after fixing this). Also curios how many table you have when got to Adminisitration->Other->Database (at top left of the opened window showing number in parenthesis to right of the openemr word.

-brady

ardenwong wrote on Saturday, February 25, 2012:

Thanks again!

I got 135 tables running under the ardenw_openemr2  database.  (somehow i got another database under the name of ardenw_openemr and seems that it’s was the residue from previous test installation.)   I think there is something wrong here.

sql mode is empty.   (i got this from   Administration > Other > Database > Variables.  Is this the one you’re asking?  Sorry i’m not familiar with this.)

Seems like I should re-install the whole OpenEMR?

Arden.

bradymiller wrote on Saturday, February 25, 2012:

Hi,
There should be 141 tables after a 4.1 install, so definitely some serious issues going on. Definitely should try a re-install and  consider logging mysql while doing this:
http://dev.mysql.com/doc/refman/5.0/en/query-log.html
-brady