I keep on getting an error when I try to update my cart or checkout after already being logged in. The error I am receiving is:
[QUOTE]Database error: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘WHERE user_id=‘1’ AND type=‘C’’ at line 1
Invalid query: DELETE FROM WHERE user_id=‘1’ AND type=‘C’[/QUOTE]
I set up a new user and this problem still happened. I also restored my database to an earlier one and I still had this problem. I am now thinking about restoring the database to an even earlier time, but I then have to figure out how to restore my products I have recently added. Unfortunately I don’t know when this problem begain so I don’t know how far back to go on the restoration. I also plan on upgrading to version 1.3.5 when a stable version is released so if the upgrade will fix this problem than I might just leave it until then. If anyone else has any ideas I would really appreciate hearing them.
Not to sound like I have know idea what I am doing, but how would I go about deleting the admin account through my SQL Database? I exported the cscart_user table and edited it in Excel, but when I imported it back into my database I just lost the whole table all together. I ended up having to restore my whole database to one that was a backup from a couple of days ago. I also tried opening the entire database with excel, but it ended up giving me a “file not loaded completely” message because of the size of my database. Also when trying to save just the user table I got an error saying that some features are not compatible with the text (tab deliminated) format. I don’t really know what these errors mean or what to do about them. If you have any suggestions on how I could go about editing my database file I would really like to hear them. Thank you for your time.
O.K. I finally figured out how to change the users, but it had no effect and I still get the same error. I now only have just the one new admin user. Any more ideas?
This is probably either caused by a corrupted or modified file Brandon so no way to explain a proper fix.
I am looking thru your files now via FTP to see if I can find the issue.
Have you added any mods or edited any files recently? I see many files within your cart have a modification date of 09/14 and 09/15. This could help to track this down.
Ok this problem seems to be caused by the file core/fn_cart.php @ function fn_save_cart_content on line #373
Looking thru this file it appears to have been modified for some hack or modification you have had done. Try backing it up then replacing it with an original file and see if it resolves the cart problem.
Note, this might also create other problems because it will be removing edits that the modification needs.
Well I’m not really sure what I did is right, but I figured out that the error was caused from when I added the Gift Certificate mod to my site. I decided to just remove this code and replace it with the original. I am no longer able to sell gift ceritificates, but at least people can check out now. I also just figure I’ll wait to mess around with gift certificates when 1.3.5 comes out since it is built in.
Thank you guys for all your help I really appreciate it.
function fn_save_cart_content(&$cart, $user_id, $mode = 'cart', $type = 'C')
{
global $db_tables;
if (!empty($user_id)) {
db_query("DELETE FROM $db_tables[user_session_products] WHERE user_id='$user_id' AND type='$type'");
$_cart = '';
if (!empty($cart['products'])) {
$_cart = addslashes(serialize($cart['products']));
}
if ($mode != 'cart') {
//fn_print_r($mode,"UPDATE $db_tables[users] SET $mode='$_cart' WHERE user_id='$user_id'");
db_query("UPDATE $db_tables[users] SET $mode='$_cart' WHERE user_id='$user_id'");
} else {
db_query("UPDATE $db_tables[users] SET cart_content='$_cart' WHERE user_id='$user_id'");
}
function fn_save_cart_content(&$cart, $user_id, $mode = 'cart')
{
global $db_tables;
if (!empty($user_id)) {
$_cart = '';
if (!empty($cart['products'])) {
$_cart = addslashes(serialize($cart['products']));
}
if ($mode != 'cart') {
db_query("UPDATE $db_tables[users] SET $mode='$_cart' WHERE user_id='$user_id'");
} else {
db_query("UPDATE $db_tables[users] SET cart_content='$_cart' WHERE user_id='$user_id'");
}
}
Yes you did and if I would have actually read your post right the first time then the simple answer would have been “yes” instead of posting all of the code. Sorry about that.