DONATE talk:Installation Manual

You got an error when we ran the create_insert.sql script ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint f ails (`donate`.`organization`, CONSTRAINT `fk_orginization_donor` FOREIGN KEY (` donorID`) REFERENCES `donor` (`donorID`))

Got a bunch of these errors in dbInstallSandbox.php

Warning: mysql_insert_id [function.mysql-insert-id]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\xampp\htdocs\donate\cis605-donate\db-control\dbEventType.php on line 78

Warning: mysql_insert_id [function.mysql-insert-id]: A link to the server could not be established in E:\xampp\htdocs\donate\cis605-donate\db-control\dbEventType.php on line 78 EventType added has id 0

Bpa22 13:33, 3 May 2011 (UTC)

To fix first error
REATE TABLE IF NOT EXISTS organization (  donorID         INT NOT      NULL,  organizationName VARCHAR(100) NULL ,  description      VARCHAR(100) NULL ,

CONSTRAINT pk_individual PRIMARY KEY (donorID), CONSTRAINT fk_orginization_donor FOREIGN KEY (donorID) REFERENCES donor (donorID) );       DESCRIBE organization;        SHOW CREATE TABLE organization\G

you have constraint pk individual instead of pk_organization primary key

and you have a missing field in the insert.

Errors found
Donate_Create_Insert - Error 1452 when loading DB. Can't add or update a child row: Foreign Key constraint fails.
 * Trying to insert a PK/FK for an organization that does not exist in donor.

DBInstallSandbox - error Line 78 of dbEventType.php
 * possible solution is adding mysql_close after echo and printf lines 70-78 area

Hld3 14:10, 3 May 2011 (UTC)