Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 8:02 am
While I know module conversion has been discussed and there are also plans for a RN eCommerce sollution, in the meantime I thought Id have a go at this.
Well alot of this Ive converted with no problems, turned error reporting on and that helped alot, even fixed the installer and added a field that was missing, bfax to be exact. Anyways Im just wondering if anyone can help me solve the last few errors that won't allow anything to be updated.
First let me start by mentioning that I removed all instances of cafepress, as it caused errors as well and I thought it would be easier to go around it, eh it sort of was, thats a much easier fix though. So I dropped all tables and ran the install again so it would be fresh. So now in admin>ccart>main ccart settings(admin.php?op=config) When trying to update/save the settings...This is RN 2.3, CCart Pro 2.0....
First the old code:
Code:
if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
include("header.php");
include("config.php");
$sql1 = mysql_query("SELECT * FROM CCart_config WHERE id=1");
And when I try to update in admin heres the output:
Code:
UPDATE CCart_config SET....all fields are displayed here....WHERE id=''.......
Error updating details: 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 id=''' at line 1
It displays every feild its trying to update so I didnt want to add that entire section here, but the last part WHERE id='' is the last field its supposed to update, and that is found here:
Code:
$sql2 = "UPDATE CCart_config SET " .
....................................lots of fields
"bfax='$busfax', " .
"WHERE id='' " ;
I included bfax to give an example of how other fields look, and Ive tried different variations of WHERE id='' etc and still get the error, while if I leave it blank or change it to 0 or anything else it updates but when you go back to the setting everything is blank.
The original fields in "update" were this:
Code:
"bfax='$busfax', " .
"cafepress='$cponoff', " .
"cpid='$cafepressid', " .
"prefn='$refern' " .
"WHERE id=1";
So in there I removed cafepress, cpid, and prefn which is PayPal referer id, and I removed all of the tables for those as well as any other queries etc and that works fine, it even shows the default settings in the "Main CCart Settings". Can anyone enlighten me as to what else the problem could be, as Ive went through the file over and over and am completely sure no other dbi functions exist, that I know of?
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 8:24 am
Was just trying to see if it would make a difference, the error doesnt occur if its not 1, like say if its blank or 0 or 11, but than it doesnt update, which isnt a solution.
Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Mon Feb 09, 2009 8:27 am
When there is a 1 in there is this message exactly the same other than a 1?
Code:
UPDATE CCart_config SET....all fields are displayed here....WHERE id=''.......
Error updating details: 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 id=''' at line 1
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 8:29 am
When theres no one no error occurs when updating, it gives the success message, but it doesnt really update and its also not creating a new field or table, I checked already..
This is the entire original:
Code:
if (!eregi("admin.php", $PHP_SELF)) { die ("Access Denied"); }
include("header.php");
include("config.php");
$sql1 = mysql_query("SELECT * FROM CCart_config WHERE id=1");
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 9:18 am
Ok did that and its showing the same output, first it shows February 9, 2009, 10:09 am SQL was: UPDATE... than it shows February 9, 2009, 10:09 am 1064 : You have an error....
I went back to the original settings, ""WHERE id=1";" and tried to update again and got the error and went back and refreshed twice and everything is updating properly, but still getting the error?
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 9:25 am
Scratch that, this isnt making sense but its not really updating, for some reason I refresh and it looks fine but when I go back through admin>ccart>settings it really hasnt updated anything...
<?php
//Calloway's Pro version 1.0a install MYSQL Tables
require("config.php");
mysql_connect($dbhost, $dbuname, $dbpass);
@mysql_select_db($dbname);
//////////////////////////////////////////////////////////////////////////////
//For security purposes delete this file after database tables are installed!!
//////////////////////////////////////////////////////////////////////////////
$query = "CREATE TABLE CCart_categories (".
"cid int(11) NOT NULL auto_increment,".
"cat varchar(150) NOT NULL default '',".
"maincat varchar(150) NOT NULL default '',".
"catdes varchar(250) default 'YES',".
"pid int(11) NOT NULL default '0',".
"image text NOT NULL,".
"PRIMARY KEY (cid))";
mysql_query($query)or die("<center>Error Creating CCart_categories: </center>".mysql_error());
$query1 = "CREATE TABLE CCart_products (".
"pid int(11) NOT NULL auto_increment,".
"name varchar(20) NOT NULL,".
"des text NOT NULL,".
"catid int(11) NOT NULL default '0',".
"pnum text NOT NULL default '',".
"imageloc text NOT NULL,".
"imgw tinyint(4) NOT NULL,".
"imgh tinyint(4) NOT NULL,".
"ialt text NOT NULL,".
"ptype text NOT NULL,".
"a1 text NOT NULL,".
"listp text NOT NULL,".
"per tinytext NOT NULL,".
"p1 tinyint(4) NOT NULL,".
"t1 tinytext NOT NULL,".
"a3 text NOT NULL,".
"p3 tinyint(4) NOT NULL,".
"t3 tinytext NOT NULL,".
"s1 text NOT NULL,".
"as2 text NOT NULL,".
"extra text NOT NULL,".
"stock text NOT NULL,".
"opta text NOT NULL,".
"optb text NOT NULL,".
"optc text NOT NULL,".
"optd text NOT NULL,".
"opte text NOT NULL,".
"optf text NOT NULL,".
"optg text NOT NULL,".
"opth text NOT NULL,".
"opti text NOT NULL,".
"optj text NOT NULL,".
"optk text NOT NULL,".
"optl text NOT NULL,".
"optm text NOT NULL,".
"optn text NOT NULL,".
"optiona text NOT NULL,".
"optionb text NOT NULL,".
"optionc text NOT NULL,".
"optiond text NOT NULL,".
"optione text NOT NULL,".
"optionf text NOT NULL,".
"optiong text NOT NULL,".
"optionh text NOT NULL,".
"optioni text NOT NULL,".
"optionj text NOT NULL,".
"optionk text NOT NULL,".
"optionl text NOT NULL,".
"optionm text NOT NULL,".
"optionn text NOT NULL,".
"optname text NOT NULL,".
"optionname text NOT NULL,".
"a2 text NOT NULL,".
"p2 text NOT NULL,".
"t2 text NOT NULL,".
"heavyitem tinytext NOT NULL,".
"specials tinytext NOT NULL,".
"specialprice tinytext NOT NULL,".
"specialsavings tinytext NOT NULL,".
"whatsnew tinytext NOT NULL,".
"pshowcase tinytext NOT NULL,".
"mann text NOT NULL,".
"mani text NOT NULL,".
"PRIMARY KEY (pid))";
mysql_query($query1) or die("<center>Error1 Creating CCart_products:</center> ".mysql_error());
$query2 = "CREATE TABLE CCart_config (".
"id int(11) NOT NULL auto_increment,".
"emailid text NOT NULL,".
"logourl text NOT NULL,".
"returnurl text NOT NULL,".
"cancelurl text NOT NULL,".
"purchaseimg text NOT NULL,".
"recurringimg text NOT NULL,".
"viewcartimg text NOT NULL,".
"addcartimg text NOT NULL,".
"viewcart tinytext NOT NULL,".
"layout text NOT NULL,".
"nukeadd tinytext NOT NULL,".
"rtsidebar tinytext NOT NULL,".
"ver tinytext NOT NULL,".
"images tinytext NOT NULL,".
"ccolumns tinytext NOT NULL,".
"subcolumns tinytext NOT NULL,".
"specialcolumns tinytext NOT NULL,".
"whatsnewcolumns tinytext NOT NULL,".
"showcasecolumns tinytext NOT NULL,".
"symbolid tinyint(4) NOT NULL default '1',".
"cartcolor tinytext NOT NULL,".
"ppimg tinytext NOT NULL,".
"note text NOT NULL,".
"inn tinytext NOT NULL,".
"productpage tinytext NOT NULL,".
"specialbox tinytext NOT NULL,".
"whatsnewbox tinytext NOT NULL,".
"showcasebox tinytext NOT NULL,".
"bphone text NOT NULL,".
"bemail text NOT NULL,".
"bhours text NOT NULL,".
"PRIMARY KEY (id))";
mysql_query($query2) or die("<center>Error2 Creating CCart_config:</center> ".mysql_error());
//////////////////////////////////////////////////////////////////////////////
//$query2 = "INSERT INTO CCart_config VALUES ('1', 'orders@theguitarfiles.com', 'logo url here', 'http://www.theguitarfiles.com',
'http://www.theguitarfiles.com', '', 'https://www.paypal.com/images/x-click-but24.gif', 'https://www.paypal.com/images/view_cart_02.gif',
'https://www.paypal.com/images/x-click-but23.gif', 'on', '', 'on', 'off', 'CCart Version 1.0a Pro', 'on', '2', '3', '2', '1', '2', 1, '0',
'off', 'How did you hear about us', '0', '5', 'on', 'on', 'on', '302-875-2990', 'orders@theguitarfiles.com', '(Mon-Fri 12-5 EST)')";
$query2 = "INSERT INTO `CCart_config` (`id`, `emailid`, `logourl`, `returnurl`, `cancelurl`, `purchaseimg`, `recurringimg`, `viewcartimg`,
`addcartimg`, `viewcart`, `layout`, `nukeadd`, `rtsidebar`, `ver`, `images`, `ccolumns`, `subcolumns`, `specialcolumns`, `whatsnewcolumns`,
`showcasecolumns`, `symbolid`, `cartcolor`, `ppimg`, `note`, `inn`, `productpage`, `specialbox`, `whatsnewbox`, `showcasebox`, `bphone`,
`bemail`, `bhours`) VALUES (1, 'orders@theguitarfiles.com', '', 'http://www.theguitarfiles.com', 'http://www.theguitarfiles.com', '',
'https://www.paypal.com/images/x-click-but24.gif', 'https://www.paypal.com/images/view_cart_02.gif',
'https://www.paypal.com/images/x-click-but23.gif', 'on', '', 'on', 'off', 'CCart Version 1.0a Pro', 'on', '2', '3', '2', '1', '2', 1, '0',
'off', 'How did you hear about us', '0', '5', 'on', 'on', 'on', '302-875-2990', 'orders@theguitarfiles.com', '(Mon-Fri 12-5 EST) ')";
//$query2 = "INSERT INTO `CCart_config` ('id', 'emailid', 'logourl', 'returnurl', 'cancelurl', 'purchaseimg', 'recurringimg', 'viewcartimg',
'addcartimg', 'viewcart', 'layout', 'nukeadd', 'rtsidebar', 'ver', 'images', 'ccolumns', 'subcolumns', 'specialcolumns', 'whatsnewcolumns',
'showcasecolumns', 'symbolid', 'cartcolor', 'ppimg', 'note', 'inn', 'productpage', 'specialbox', 'whatsnewbox', 'showcasebox', 'bphone',
'bemail', 'bhours') VALUES (1, 'orders@theguitarfiles.com', '', 'http://www.theguitarfiles.com', 'http://www.theguitarfiles.com', '',
'https://www.paypal.com/images/x-click-but24.gif', 'https://www.paypal.com/images/view_cart_02.gif',
'https://www.paypal.com/images/x-click-but23.gif', 'on', '', 'on', 'off', 'CCart Version 1.0a Pro', 'on', '2', '3', '2', '1', '2', 1, '0',
'off', 'How did you hear about us', '0', '5', 'on', 'on', 'on', '000-000-0000', 'orders@yoursite.com', '(Mon-Fri 8-4 EST)')";
mysql_query($query2) or die("<center>Error: Inserting Config Details:</center> ".mysql_error());
//////////////////////////////////////////////////////////////////////////////
$sql4 = "CREATE TABLE CCart_currency (".
"id int(11) NOT NULL auto_increment,".
"code tinytext NOT NULL,".
"symbol tinytext NOT NULL,".
"PRIMARY KEY (id))";
mysql_query($sql4) or die("Error4 Creating CCart_currency: ".mysql_error());
//////////////////////////////////////////////////////////////////////////////
$sql7 = "INSERT INTO CCart_currency VALUES ('1', 'USD', '$')";
mysql_query($sql7) or die("Error7 Inserting currency Details: ".mysql_error());
$sql8 = "INSERT INTO CCart_currency VALUES ('2', 'EUR', '€')";
mysql_query($sql8) or die("Error8 Inserting currency Details: ".mysql_error());
$sql9 = "INSERT INTO CCart_currency VALUES ('3', 'GBP', '£')";
mysql_query($sql9) or die("Error9 Inserting currency Details: ".mysql_error());
$sql10 = "INSERT INTO CCart_currency VALUES ('4', 'CAD', '$')";
mysql_query($sql10) or die("Error10 Inserting currency Details: ".mysql_error());
$sql11 = "INSERT INTO CCart_currency VALUES ('5', 'JPY', '¥')";
mysql_query($sql11) or die("Error11 Inserting currency Details: ".mysql_error());
////////////////////////////////////////////////////////////////////////////////////
echo "<Center>Good News...<h2>CALLOWAY'S CART PRO (ver 1.0a)</h2> <br>Tables Were Installed Sucessfully. <br><br>Enjoy this version and future updates/releases<br> at: <a href=\"http://www.theguitarfiles.com/CC/CallowaysCart\">www.theguitarfiles.com/CC/CallowaysCart</a>";
echo "<br><br>Thanks <br>Brian Calloway<br><br></center>";
//END
?>
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 10:01 am
Thanks Im trying that now, as far as I know though, installs never work without "require_once('mainfile.php');" also, its still missing the bfax fields.
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Mon Feb 09, 2009 10:16 am
That would be awesome... I went ahead and tried it just as you posted, but I had to add the require mainfile still... Still gives the error, didnt get an error for the bfax field not existing so thats not a problem right now. Can you elaborate what might cause ""WHERE id=1";" to return an error? btw, if you were to update it back as a donation service, Im all over it....
I just want to note I said "I may Bring CCart up to date exclusively for RavenNuke(tm)" but there are no plans as of yet and I don't want to mislead the public or current users of CCart Pro. RavenNuke Merchant(tm) is in the works as noted throughout the forums and on the front page. So that's my (our) main priority. If I (we) do decide to upgrade CCart Pro it would be posted as an announcement and approved by RavenNuke(tm) LTD.
I do want to thank everything that supported me and the CCart Pro project in the past.
Sorry the code posted wasn't the upgrade script but the original install.. Like Homer would say Doh... Sorry I have the Flu so my thoughts are not in tip top shape today. I will have to dig that up and see what's going on..
Just wondering if your using the right upgrade script. The last version was 2.0b. Did you download from my site or from another source? I added the bfax in the last release.
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Tue Feb 10, 2009 4:51 am
Calloway's_Cart_Pro_v.2.1b/cc_update_2.0b.php contains the bfax addition, sorry I hadnt noticed this before, I wasnt running that I was only running the original install in that dir.
So it looks like its updating now, it doesnt appear to be updating the currency but I might have done something to cause that, I still have some of the original dbi to update as well, just module files though Ill post back if the currency doesnt work, with the changes I made. I went ahead and added everything back that I had removed and its not returning any errors. Thanks for being patient and pointing that out for me.
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Tue Feb 10, 2009 7:05 am
Just wondering if this looks right, I didnt see anything on connect and close mentioned anywhere...
Old:
Code:
$link = mysql_connect($dbhost,$dbuname, $dbpass) OR DIE ("Unable To Connect To Database");
mysql_select_db($dbname, $link) OR DIE("Unable To Select To Database");
$sql = "SELECT pid,name, pnum, a1, listp, specialprice,numberstock,stock FROM CCart_products ORDER BY name LIMIT $offset,$searchrows";
$result = $db->sql_query($sql);
mysql_close($link);
New:
Code:
$link = $db->sql_connect($dbhost,$dbuname, $dbpass) OR DIE ("Unable To Connect To Database");
$db->sql_select_db($dbname, $link) OR DIE("Unable To Select To Database");
$sql = "SELECT pid,name, pnum, a1, listp, specialprice,numberstock,stock FROM CCart_products ORDER BY name LIMIT $offset,$searchrows";
$result = $db->sql_query($sql);
$db->sql_close($link);
I had already changed some of it before I noticed the rest, not sure though I did try google...wasnt much help.
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Tue Feb 10, 2009 12:12 pm
I got everything else converted. The above is needed for inventory.php and orders.php, and after a second glance ipn.php also uses the same, so testing can be achieved but only to a certain extent. I tried different things to get those working but gave up for now, after all the converting Im tired... On a side note miss typing num_rows will give you num_toes...
Let me know if you want me to send it all, I added the new ipn as well, for some reason I converted the old files too, guess I got bored...
Joined: Jan 17, 2009 Posts: 268 Location: Missouri
Posted:
Tue Feb 10, 2009 3:02 pm
Hmm...Well I was using the old install at first, I hadnt noticed there was another in your "scripts" download. So than I ran the upgrade script, and than I converted all the old dbi, and now the last remaining issues are the above. Other than that everything works.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum