<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OpenKB::Server Technical Papers &#187; oscommerce</title>
	<atom:link href="http://www.openkb.org/category/oscommerce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openkb.org</link>
	<description>Computer , server issues and solutions</description>
	<lastBuildDate>Sat, 17 Jul 2010 21:16:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>1064 &#8211; SQL query error oscommerce</title>
		<link>http://www.openkb.org/1064-sql-query-error-oscommerce/</link>
		<comments>http://www.openkb.org/1064-sql-query-error-oscommerce/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 20:00:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[oscommerce]]></category>

		<guid isPermaLink="false">http://blog.masadmin1.com/?p=110</guid>
		<description><![CDATA[1064 &#8211; 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 &#8216;-20, 20&#8242; at line 1 To fix this In admin/includes/classes find split_page_results.php and &#8211; BACK IT UP then find the lines $offset = ($max_rows_per_page * ($current_page_number &#8211; 1)); [...]]]></description>
			<content:encoded><![CDATA[<p><span class="searchlite">1064</span> &#8211; 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 &#8216;-20, 20&#8242; at line 1</p>
<p>To fix this</p>
<p>In admin/includes/classes find split_page_results.php and &#8211; BACK IT UP then find the lines</p>
<p>$offset = ($max_rows_per_page * ($current_page_number &#8211; 1));<br />
$sql_query .= &#8221; limit &#8221; . $offset . &#8220;, &#8221; . $max_rows_per_page;</p>
<p>change to</p>
<p>$offset = ($max_rows_per_page * ($current_page_number &#8211; 1));<br />
if ($offset &lt; 0)<br />
{<br />
$offset = 0 ;<br />
}<br />
$sql_query .= &#8221; limit &#8221; . $offset . &#8220;, &#8221; . $max_rows_per_page;</p>
<p>MySQL 4.1.xx handles negatives correctly (by forcing an error) in the code above unlike earlier versions of MySQL.</p>
<p>=========</p>
<p>Thanks to  <span class="postdetails">   Charles Kangethe on http://forums.oscommerce.com/index.php?showtopic=144095&amp;hl=1064<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.openkb.org/1064-sql-query-error-oscommerce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
