?>
<?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>Matt Gibson &#187; PHPList</title>
	<atom:link href="http://www.mattgibson.ca/tags/phplist/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattgibson.ca</link>
	<description>I'm one of those people radio shows call for obscure shit.</description>
	<lastBuildDate>Sat, 03 Dec 2011 19:30:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Fixing MySQL Error 1064 with PHPList when selecting new criteria</title>
		<link>http://www.mattgibson.ca/2009/01/29/fixing-mysql-error-1064-with-phplist-when-selecting-new-criteria/</link>
		<comments>http://www.mattgibson.ca/2009/01/29/fixing-mysql-error-1064-with-phplist-when-selecting-new-criteria/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 22:04:51 +0000</pubDate>
		<dc:creator>Matt G</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[PHPList]]></category>

		<guid isPermaLink="false">http://www.mattgibson.ca/?p=172</guid>
		<description><![CDATA[Today we had to fix a clients PHPlist. There was an error in their mysql select statement for whatever reason &#8211; whether it was their setup (they had some really weird group names and country names) or something with PHPList. Took us a while to figure it out, but as it turns out someone else [...]]]></description>
			<content:encoded><![CDATA[<p>Today we had to fix a clients PHPlist. There was an error in their mysql select statement for whatever reason &#8211; whether it was their setup (they had some really weird group names and country names) or something with PHPList. Took us a while to figure it out, but as it turns out someone <a href="http://mantis.phplist.com/view.php?id=15182">else had the same issue</a>.</p>
<p>Basically the fix is this:</p>
<p># nano /lists/admin/send_core.php</p>
<p>Find this</p>
<p>if (is_array($_POST["criteria_values"])) {<br />
$values = join(&#8220;, &#8220;,$_POST["criteria_values"]);<br />
} else {<br />
$values = $_POST["criteria_values"];<br />
}</p>
<p>and replace it with this</p>
<p>if (is_array($_POST["criteria_values"])) {<br />
# The following code checks for null values in the criteria_attribute array and removes them<br />
$values = $_POST["criteria_values"];<br />
foreach ($values as $key=&gt;$value) {<br />
if (!$value) {<br />
array_splice($values, $key, 1); // Remove null value from array<br />
}<br />
}<br />
$values = join(&#8220;, &#8220;,$values);<br />
#  $values = join(&#8220;, &#8220;,$_POST["criteria_values"]);<br />
} else {<br />
$values = $_POST["criteria_values"];<br />
}</p>
<p>Now everything should work, with no more mysql errors!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattgibson.ca/2009/01/29/fixing-mysql-error-1064-with-phplist-when-selecting-new-criteria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

