<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — db connection scripts fixes]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7043</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7043&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in db connection scripts fixes.]]></description>
		<lastBuildDate>Fri, 27 Oct 2017 09:10:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29252#p29252</link>
			<description><![CDATA[<p>Isn&#039;t it better to be a little permissive when a change from strstr to stristr isn&#039;t any great penalty?<br />And also a check to see if it is the first word in the sql?</p><p>Also if it is not going to be fixed in the core <a href="https://github.com/apmuthu/frontac24/commit/a43faa9e414750f6540b852d49be6437faedcc70">it will reside in my FA24Mods</a>.<br />Thanks for the policy info.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 27 Oct 2017 09:10:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29252#p29252</guid>
		</item>
		<item>
			<title><![CDATA[Re: db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29246#p29246</link>
			<description><![CDATA[<p>Following our non-written coding policy regarding sql statements (like using capital letters for sql keywords) there is no need for additional cleanups here :-).<br />Janusz</p>]]></description>
			<author><![CDATA[null@example.com (itronics)]]></author>
			<pubDate>Fri, 27 Oct 2017 07:50:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29246#p29246</guid>
		</item>
		<item>
			<title><![CDATA[Re: db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29244#p29244</link>
			<description><![CDATA[<p>The <strong>stristr</strong> is okay to fix instead of the regex except that it will not address checking if it is the first word in the sql.<br />The idea is that it should be the beginning of the string and not inbetween like <em>CREATE TABLE xxx SELECT * from ....</em></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 27 Oct 2017 07:40:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29244#p29244</guid>
		</item>
		<item>
			<title><![CDATA[Re: db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29240#p29240</link>
			<description><![CDATA[<p>Not really, maybe a change to stristr instead of strstr.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Thu, 26 Oct 2017 23:02:21 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29240#p29240</guid>
		</item>
		<item>
			<title><![CDATA[Re: db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29093#p29093</link>
			<description><![CDATA[<p>@joe: any thoughts?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 19 Oct 2017 06:07:40 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29093#p29093</guid>
		</item>
		<item>
			<title><![CDATA[db connection scripts fixes]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=29058#p29058</link>
			<description><![CDATA[<p>The db connection scripts reside in the <strong>includes/db/</strong> folder.</p><p>The currently acceptable db drivers there are:<br /></p><div class="codebox"><pre><code>connect_db_mysqli.inc
connect_db_mysql.inc</code></pre></div><p>Line 15 in the MySQLi driver file above is:<br /></p><div class="codebox"><pre><code>$db_last_inserted_id = 0;</code></pre></div><p>This needs to be ported to the MySQL driver too.</p><p>The <strong>function db_query()</strong> in both driver files have a line (78/79):<br /></p><div class="codebox"><pre><code>        if ($SysPrefs-&gt;select_trail || (strstr($sql, &#039;SELECT&#039;) === false)) {</code></pre></div><p>It is better coded to make the <strong>SELECT</strong> be the beginning part of the search string and case insensitive as well (<strong>stristr</strong> ?) like:<br /></p><div class="codebox"><pre><code>        $sql = trim($sql);
        if ($SysPrefs-&gt;select_trail || (preg_match(&#039;/^SELECT/i&#039;, $sql) === 0)) {</code></pre></div><p>According to the PHP Manual:<br /></p><div class="quotebox"><blockquote><p>preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match.</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 15 Oct 2017 10:23:09 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=29058#p29058</guid>
		</item>
	</channel>
</rss>
