View Full Version : Cannot Insert Transaction Into Database
Has anyone ever encountered this error? I had 5 different customers - some from home and some from work - who when they entered "Add to Cart" from our site at www.romanticroomdesigns.com got a white screen with the words "Cannot insert transaction into database". When I try to order something from our own site, it always works (tried on Firefox, Safari and IE) Called PowWeb Support and they said it works on their support computers so there is no problem (but of course there is). Any ideas? Thank you for any assistance.
Seems to be working now, for me, from here.
This is strange. I had several friends and family try to order something off of our site and they had not problems. However, I am still getting several people a day since Monday contacting me saying "Hey, when I press the Add to Cart button on your site, it goes to a white screen and says 'cannot insert transaction into database." Still trying to figure this out. PayPal says it is not their fault. PowWeb says it is not their issue either. Site had been working fine as is the past 3 years but now some customers cannot order. Does anyone have any ideas or experienced the same issues?
In looking at the code on one of my pages (additems.php) I did find a statement that matches what people see sometimes (Cannot Insert Transaction Into Database). Powweb had me change some information recently in another file (database.php). Could this be the problem?
$query1 = "INSERT INTO transactions (Reference, Sessionid, Yourname, Contactinfo, Description, Amount, Significantother, Roomname, Hotelname, Confirmationnumber, Checkindate, Checkintime, Bonfiredate, Bonfiretime, Personalmessage, Comments, Gift) VALUES ('0', '$session_id', '$name', '$contactinfo', '$title', '$amount', '$significantother', '$roomname', '$hotelname', '$confirmationnumber', '$checkindate', '$checkintime', '$bonfiredate', '$bonfiretime', '$personalmessage', '$comments', '$gift')";
mysql_db_query($dbname, $query1, $link) or die("Cannot Insert Transaction Into Database");
all that really tells you is that the mysql db query failed, but not really why. You can try adding some debugging output to that, if you don't mind your customers seeing it. Or write the errors to a text file you can read later. check out mysql_error() on getting error messages (and similar stuff).
http://us3.php.net/manual/en/function.mysql-error.php
Dbrazzell
8-6-09, 11:52 AM
Change
or die("Cannot Insert Transaction Into Database");
to
or die("Cannot Insert Transaction Into Database Reason:" . mysql_error());
Right now that error message doesn't mean much to us. There are many reasons why the query might be failing. mMysql_error() will tell us something more informative.
Dbrazzell
8-6-09, 11:53 AM
Satis beat me to it :)
Thank you - I will try that right now.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.