Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download, /proc/kallsyms format, sqldatasource dal, wwwxxxenden

Links

XODOX
Impressum

#1: RE: 47951 by: Chris Stinemetz

Posted on 2011-08-06 12:36:15 by Geoffrey Pitman

--0016e68dd2d29d71c304a9d3c8e1
Content-Type: text/plain; charset=ISO-8859-1

I hope this isn't condescending, but you have a foreign key constraint that
is failing. I would probably echo the output of $_POST['post_store'] to see
what value, if any, is being written. If the output seems proper, I'd check
your other table and make sure that the data exists in that table. And,
finally if all of that checks out, I'd check your SQL and see if you have
appropriate data types, etc.

I hope that may help.

Geoff

From: Chris Stinemetz <chrisstinemetz@gmail.com>
To: php-db@lists.php.net
Date: Fri, 5 Aug 2011 23:41:06 -0500
Subject: Insert query error
I am getting the following error trying to run the below query. Any
suggestions on what I am doing wrong?

Thank you,

Something went wrong while inserting your store visitCannot add or
update a child row: a foreign key constraint fails (`store`.`posts`,
CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`post_store`) REFERENCES
`stores` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)

$sql = "INSERT INTO
posts(market, type, post_store, post_tptest, post_content, post_by,
post_date)
VALUES('" . mysql_real_escape_string($_
POST['market']) . "',
'" . mysql_real_escape_string($_POST['type']) . "',
'" . mysql_real_escape_string($_POST['post_store']) . "',
'" . sha1($_POST['post_tptest']) . "',
'" . mysql_real_escape_string($_POST['post_content']) . "',
" . $_SESSION['user_id'] . ",
NOW())";

--0016e68dd2d29d71c304a9d3c8e1--

Report this message