rnrstar
unread,Aug 27, 2010, 8:12:20 PM8/27/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to RISE
I have three tables, IncommingTexts, Notes, and Users. I have a 1 to
0..n relation from IncommingTexts to Notes and a 1 to 0...n relation
from Users to Notes.
I'm trying to create a new note record using the php db methods
generated by RISE. My call looks something like:
$notesObj = new spDBINotes($ConnectionResource);
$notesObj->NewNotes($UsersID, $IncommingTextsID, $txtNote, $datAdded);
I get the following error:
Fatal error: Uncaught exception 'Exception' with message 'INSERT INTO
"t_sp_u_Notes"("c_u_txtNote", "c_u_datAdded", "c_r_IncommingTexts",
"c_r_Users") VALUES (?, ?, ?, ?): Cannot add or update a child row: a
foreign key constraint fails ("southpoint/t_sp_u_Notes", CONSTRAINT
"fk_sp_u_Notes_r_IncommingTexts" FOREIGN KEY ("c_r_IncommingTexts")
REFERENCES "t_sp_u_IncommingTexts" ("c_id"))' in /home/leaddomain/
public_html/southpoint/sp.DB.INotes.php:26 Stack trace: #0 /home/
leaddomain/public_html/southpoint/saveNewNote.php(56): spDBINotes-
>NewNotes('1', '2', 'test', '2010-08-27 17:5...') #1 {main} thrown in /
home/leaddomain/public_html/southpoint/sp.DB.INotes.php on line 26
Line 25-26 is...
if(!$mysqli_stmt->execute())
throw new Exception($sql_stmt.': '.$mysqli_stmt->error);
Using MyPHPAdmin I'm able to manually insert a row into the Notes
table without problem.
Any ideas?
Thanks in advance.