If you're getting the warning "I am able to write to the configuration file" ... "configure.php" in Zencart in Windows and are unsure about how to chmod in windows.
Relax, all you need to do is set the file to read only.
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Saturday, October 31, 2009
Zen cart 1064 TYPE=MyISAM Problem
If you're getting the following error when trying to install Zencart:
"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 'TYPE=MyISAM' at line 1"
It is likely that you are trying to install on a relatively old MySQL version. To get around this problem:
1) find and open the file "zc_install\sql\mysql_zencart.sql"
2) Replace all instances of "TYPE=MyISAM" with "ENGINE=MyISAM"
That should help solve the problem.
"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 'TYPE=MyISAM' at line 1"
It is likely that you are trying to install on a relatively old MySQL version. To get around this problem:
1) find and open the file "zc_install\sql\mysql_zencart.sql"
2) Replace all instances of "TYPE=MyISAM" with "ENGINE=MyISAM"
That should help solve the problem.
How to run PHP in a Tomcat server instance
One of the very few tutorials that actually works, thanks to the blog pointing to both a download for PHP and PECL libraries that match each other:
How to Run PHP 5.x with Apache Tomcat 4.x or Apache Tomcat 5.x @ AurosBlog
How to Run PHP 5.x with Apache Tomcat 4.x or Apache Tomcat 5.x @ AurosBlog
Friday, October 30, 2009
Updating a table in SQL where records in table A don't exist in table B.
I find myself doing this a lot recently, so I'm posting it here too. Hopefully it is SQL92 and should run on just about anything.
1. Updating a table in SQL where records in table A don't exist in table B:
insert into tableB (field1, field2, field3)
select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 like '%bleh%'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2);
2. Hey, and why not do something silly like have a union query and some limit in the mix (limit works in MySQL only):
insert into tableB (field1, field2, field3)
select field1, field2, field3 from
(select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 like 'bleh'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2)
limit 10) A1
union
select field1, field2, field3 from
(select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 not like 'bleh'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2)
limit 10) A2;
1. Updating a table in SQL where records in table A don't exist in table B:
insert into tableB (field1, field2, field3)
select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 like '%bleh%'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2);
2. Hey, and why not do something silly like have a union query and some limit in the mix (limit works in MySQL only):
insert into tableB (field1, field2, field3)
select field1, field2, field3 from
(select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 like 'bleh'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2)
limit 10) A1
union
select field1, field2, field3 from
(select f1 as field1, f2 as field2, f3 as field3
from tableA A
WHERE
A.f1 not like 'bleh'
and not exists(SELECT * FROM tableB WHERE f1=A.f1 and f2=A.f2)
limit 10) A2;
Wednesday, October 14, 2009
MySQL: Updating from the same table
You might ask 'why' I am doing this, but that's not the point. To update a field in a table in mysql, from the same table (which MySQL disallows):
UPDATE mytable
set myvalue = myvalue+(select myvalue FROM (select myvalue from mytable where year='2008') b )
where
year = 2009
Basically, you have to trick mysql into selecting the subquery from a temporary table; as done above.
Kudos to Peter Geer for the idea for this.
UPDATE mytable
set myvalue = myvalue+(select myvalue FROM (select myvalue from mytable where year='2008') b )
where
year = 2009
Basically, you have to trick mysql into selecting the subquery from a temporary table; as done above.
Kudos to Peter Geer for the idea for this.
Subscribe to:
Posts (Atom)