<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>dibi forum</title>
<link>http://forum.dibiphp.com/en</link>
<description> dibi forum</description>
<language>cs</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>DIBI API – vyhledává v Nette API (Bug Reports)</title>
	<dc:creator>iguana007</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2444#p2444</link>
	<guid isPermaLink="false">2444@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;Rád bych nahlásil bug v Dibi API, který s počívá v tom, že, když
si dám něco vyhledat přes input v pravo nahoře, tak mi to vyhledává na
nette webu místo na dibi :)&lt;/p&gt;

&lt;!-- by Texy2! --&gt;</description>
	<pubDate>Wed, 27 Oct 2010 15:30:38 +0200</pubDate>
</item>
<item>
	<title>implementace DibiDatabaseInfo::initForeignKeys() (General Discussion)</title>
	<dc:creator>pekelnik</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2443#p2443</link>
	<guid isPermaLink="false">2443@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;ahoj,&lt;/p&gt;

&lt;p&gt;tady je zkusmá implementace této metody pro postgres – myslím, že tato
metoda bude muset být delegována na driver.&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-comment&quot;&gt;/**
 * Init Foreign Key Information
 * @return void
 */&lt;/span&gt;
&lt;span
class=&quot;php-keyword1&quot;&gt;protected&lt;/span&gt; &lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; initForeignKeys()
{
        &lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;foreignKeys = &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;();
        &lt;span
class=&quot;php-var&quot;&gt;$r&lt;/span&gt; = dibi::getConnection()-&amp;gt;getDriver()-&amp;gt;getResource();

        &lt;span
class=&quot;php-var&quot;&gt;$q&lt;/span&gt; = &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;
                SELECT
                        tc.constraint_name, tc.table_name, kcu.column_name,
                        ccu.table_name AS foreign_table_name,
                        ccu.column_name AS foreign_column_name
                FROM
                        information_schema.table_constraints AS tc
                        JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name
                        JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name
                WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name = '&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;name . &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;;

        &lt;span
class=&quot;php-var&quot;&gt;$result&lt;/span&gt; = pg_query(&lt;span class=&quot;php-var&quot;&gt;$r&lt;/span&gt;, &lt;span
class=&quot;php-var&quot;&gt;$q&lt;/span&gt;);

        &lt;span class=&quot;php-var&quot;&gt;$rows&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;();
        &lt;span
class=&quot;php-var&quot;&gt;$rows&lt;/span&gt; = pg_fetch_all(&lt;span
class=&quot;php-var&quot;&gt;$result&lt;/span&gt;);
        &lt;span
class=&quot;php-keyword1&quot;&gt;while&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$row&lt;/span&gt; = pg_fetch_assoc(&lt;span
class=&quot;php-var&quot;&gt;$result&lt;/span&gt;)) {
                &lt;span
class=&quot;php-var&quot;&gt;$rows&lt;/span&gt;[] = &lt;span
class=&quot;php-var&quot;&gt;$row&lt;/span&gt;;
        }

        &lt;span
class=&quot;php-keyword1&quot;&gt;if&lt;/span&gt; (&lt;span
class=&quot;php-var&quot;&gt;$rows&lt;/span&gt;) {
                &lt;span
class=&quot;php-keyword1&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;php-var&quot;&gt;$rows&lt;/span&gt; as &lt;span
class=&quot;php-var&quot;&gt;$row&lt;/span&gt;) {
                        &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;();
                        &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt;[&lt;span class=&quot;php-quote&quot;&gt;'local'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'table'&lt;/span&gt;] = &lt;span class=&quot;php-var&quot;&gt;$row&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'table_name'&lt;/span&gt;];
                        &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt;[&lt;span class=&quot;php-quote&quot;&gt;'local'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'column'&lt;/span&gt;] = &lt;span class=&quot;php-var&quot;&gt;$row&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'column_name'&lt;/span&gt;];
                        &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'foreign'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'table'&lt;/span&gt;] = &lt;span class=&quot;php-var&quot;&gt;$row&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'foreign_table_name'&lt;/span&gt;];
                        &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'foreign'&lt;/span&gt;][&lt;span
class=&quot;php-quote&quot;&gt;'column'&lt;/span&gt;] = &lt;span class=&quot;php-var&quot;&gt;$row&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'foreign_column_name'&lt;/span&gt;];

                        &lt;span
class=&quot;php-var&quot;&gt;$info&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;new&lt;/span&gt; DibiForeignKeyInfo(&lt;span
class=&quot;php-var&quot;&gt;$row&lt;/span&gt;[&lt;span
class=&quot;php-quote&quot;&gt;'constraint_name'&lt;/span&gt;], &lt;span
class=&quot;php-var&quot;&gt;$references&lt;/span&gt;);
                        &lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;foreignKeys[] = &lt;span
class=&quot;php-var&quot;&gt;$info&lt;/span&gt;;
                }
        }
}
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Tue, 23 Mar 2010 14:06:53 +0100</pubDate>
</item>
<item>
	<title>feature request: cache (General Discussion)</title>
	<dc:creator>gotisch</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2442#p2442</link>
	<guid isPermaLink="false">2442@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;is there a planned feature to add cache for queries?&lt;/p&gt;

&lt;p&gt;something like&lt;/p&gt;

&lt;p&gt;$connection-&amp;gt;querywithcache(“thequery”,1800);&lt;/p&gt;

&lt;p&gt;to query database only every 1800 seconds and else return cached values?&lt;br&gt;
i solved it currently with&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-var&quot;&gt;$query&lt;/span&gt; = &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;SELECT ach.achievement AS achievementID, from_unixtime(ach.date) as achievementTime, g.name AS guildname,g.guildId,`c`.*,a.locked AS accbanned,a.gmlevel,a.username,gr.rname FROM [:chars:character_achievement] ach
                                LEFT JOIN [:chars:characters] AS c ON c.guid=ach.guid
                                LEFT JOIN [:chars:guild_member] AS gd ON c.guid=gd.guid
                                LEFT JOIN [:chars:guild_rank] AS gr ON gr.guildid=gd.guildid AND gr.rid=gd.rank
                                LEFT JOIN [:chars:guild] AS g ON gd.guildid = g.guildId
                                LEFT JOIN [:realm:account] AS a ON a.id=c.account
                                WHERE ach.date &amp;gt; ( UNIX_TIMESTAMP( ) - ( 3 *24 *60 *60 ) )
                                ORDER BY ach.date DESC LIMIT 0,15&amp;quot;&lt;/span&gt;;
        &lt;span
class=&quot;php-var&quot;&gt;$filename&lt;/span&gt; = &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;/tmp/dbcache/&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-keyword2&quot;&gt;md5&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$query&lt;/span&gt;);
        &lt;span
class=&quot;php-comment&quot;&gt;// check cache:
&lt;/span&gt;        &lt;span
class=&quot;php-var&quot;&gt;$limit&lt;/span&gt; = &lt;span class=&quot;php-num&quot;&gt;300&lt;/span&gt;; &lt;span
class=&quot;php-comment&quot;&gt;// limit of 5 min
&lt;/span&gt;        &lt;span
class=&quot;php-keyword1&quot;&gt;if&lt;/span&gt; (&lt;span
class=&quot;php-keyword2&quot;&gt;file_exists&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$filename&lt;/span&gt;) &amp;amp;&amp;amp; &lt;span
class=&quot;php-keyword2&quot;&gt;filemtime&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$filename&lt;/span&gt;) &amp;gt; &lt;span
class=&quot;php-keyword2&quot;&gt;time&lt;/span&gt;()-&lt;span
class=&quot;php-var&quot;&gt;$limit&lt;/span&gt;) {
                &lt;span
class=&quot;php-var&quot;&gt;$all&lt;/span&gt; = &lt;span
class=&quot;php-keyword2&quot;&gt;unserialize&lt;/span&gt;(&lt;span
class=&quot;php-keyword2&quot;&gt;file_get_contents&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$filename&lt;/span&gt;));
        } &lt;span
class=&quot;php-keyword1&quot;&gt;else&lt;/span&gt; {
                &lt;span
class=&quot;php-var&quot;&gt;$result&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$connection&lt;/span&gt;-&amp;gt;query(&lt;span
class=&quot;php-var&quot;&gt;$query&lt;/span&gt;);
                &lt;span
class=&quot;php-var&quot;&gt;$all&lt;/span&gt; = &lt;span
class=&quot;php-var&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetchAll();
                &lt;span
class=&quot;php-keyword1&quot;&gt;if&lt;/span&gt; (!&lt;span
class=&quot;php-keyword2&quot;&gt;file_exists&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;/tmp/dbcache/&amp;quot;&lt;/span&gt;))
                        &lt;span
class=&quot;php-keyword2&quot;&gt;mkdir&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;/tmp/dbcache/&amp;quot;&lt;/span&gt;, &lt;span
class=&quot;php-num&quot;&gt;0777&lt;/span&gt;);
                &lt;span
class=&quot;php-keyword1&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;php-var&quot;&gt;$fp&lt;/span&gt; = &lt;span
class=&quot;php-keyword2&quot;&gt;fopen&lt;/span&gt;(&lt;span class=&quot;php-var&quot;&gt;$filename&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;'w'&lt;/span&gt;)) {
                        &lt;span
class=&quot;php-keyword2&quot;&gt;fwrite&lt;/span&gt;(&lt;span class=&quot;php-var&quot;&gt;$fp&lt;/span&gt;, &lt;span
class=&quot;php-keyword2&quot;&gt;serialize&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$all&lt;/span&gt;));
                        &lt;span
class=&quot;php-keyword2&quot;&gt;fclose&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$fp&lt;/span&gt;);
                }
        }
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;having dibi do it automagically (if wanted) would be really cool.&lt;/p&gt;</description>
	<pubDate>Sun, 07 Mar 2010 20:54:35 +0100</pubDate>
</item>
<item>
	<title>inserting html tags – embeds or so (General Discussion)</title>
	<dc:creator>Jan Tvrdík</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2441#p2441</link>
	<guid isPermaLink="false">2441@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;AFAIK dibi do not escape HTML characters in any case. Isn't the problem
somewhere else? Are you sure that the string you put in query method isn't
already escaped?&lt;/p&gt;</description>
	<pubDate>Wed, 06 Jan 2010 13:03:02 +0100</pubDate>
</item>
<item>
	<title>inserting html tags – embeds or so (General Discussion)</title>
	<dc:creator>Kukosk</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2440#p2440</link>
	<guid isPermaLink="false">2440@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;hi,&lt;br&gt;
i have got one problem in dibi…&lt;br&gt;
when i want to insert html code of some embed, and i use %s, or so, it inserts
escaped characters…&lt;/p&gt;

&lt;p&gt;dont you want to add some modifier ? for example %html or so ? it would be
perfect :)&lt;/p&gt;

&lt;p&gt;any solution ?&lt;br&gt;
thanks&lt;/p&gt;</description>
	<pubDate>Tue, 05 Jan 2010 23:25:28 +0100</pubDate>
</item>
<item>
	<title>[dibi, nette 0.9.1] DibiFluent-&#x26;#x3E;applyLimit() nefunguje (Bug Reports)</title>
	<dc:creator>gapon</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2439#p2439</link>
	<guid isPermaLink="false">2439@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;ukázka (testováno s mysql i mysqli driverem):&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span
class=&quot;php-comment&quot;&gt;//$this-&amp;gt;template-&amp;gt;allNews = $news-&amp;gt;applyLimit($paginator-&amp;gt;getLength(), $paginator-&amp;gt;getOffset()); // DOES NOT WORK!!!
&lt;/span&gt;    &lt;span
class=&quot;php-var&quot;&gt;$this&lt;/span&gt;-&amp;gt;template-&amp;gt;allNews = &lt;span
class=&quot;php-var&quot;&gt;$news&lt;/span&gt;-&amp;gt;getIterator(&lt;span
class=&quot;php-var&quot;&gt;$paginator&lt;/span&gt;-&amp;gt;getOffset(), &lt;span
class=&quot;php-var&quot;&gt;$paginator&lt;/span&gt;-&amp;gt;getLength());
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;první řádek skončí nevalidním SQL dotazem (“… APPLY LIMIT
10 5”)&lt;/p&gt;</description>
	<pubDate>Mon, 19 Oct 2009 13:48:06 +0200</pubDate>
</item>
<item>
	<title>Close connection (General Discussion)</title>
	<dc:creator>David Grudl</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2438#p2438</link>
	<guid isPermaLink="false">2438@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;Connections (and resultset) are closed and released from memory
automatically, you do not need to call &lt;code&gt;disconnect()&lt;/code&gt;.&lt;/p&gt;</description>
	<pubDate>Wed, 15 Jul 2009 12:33:02 +0200</pubDate>
</item>
<item>
	<title>Close connection (General Discussion)</title>
	<dc:creator>gotisch</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2437#p2437</link>
	<guid isPermaLink="false">2437@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;Do i need to call&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dibi::disconnect();&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;at the end of every page or is that done automatically? currently
im using&lt;/p&gt;

&lt;p&gt;config.php&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require_once(&quot;libs/dibi.min.php&quot;);
$config_Bugtracker = array (
        'driver'    =&amp;gt; 'mysql',
        'host'      =&amp;gt; 'localhost',
/*...*/
        'charset'   =&amp;gt; 'utf8',
        'lazy'      =&amp;gt; true     //we set lazy so that connection is only made if we use it.
        );
dibi::connect( $config_Bugtracker , 'BugTracker' );&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and in file where query is done:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;include(&quot;config.php&quot;);
        $connection = dibi::getConnection(&quot;BugTracker&quot;);
        $result = $connection-&amp;gt;query(&quot;  SELECT  blablabla&quot;,$username);
        unset($result);&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;is that enough or do i need to add the dibi::disconnect in file where query
is done?&lt;/p&gt;</description>
	<pubDate>Tue, 14 Jul 2009 17:35:25 +0200</pubDate>
</item>
<item>
	<title>SQL Function in query (General Discussion)</title>
	<dc:creator>David Grudl</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2436#p2436</link>
	<guid isPermaLink="false">2436@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;You can use this:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;php-var&quot;&gt;$insert&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;(
        &lt;span
class=&quot;php-quote&quot;&gt;'username'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$username&lt;/span&gt;),
        &lt;span
class=&quot;php-quote&quot;&gt;'pass%sql'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;'SHA1(%s)'&lt;/span&gt;,  &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$username&lt;/span&gt;&lt;span
class=&quot;php-quote&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;php-var&quot;&gt;$password&lt;/span&gt;&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;&lt;/span&gt;)), &lt;span
class=&quot;php-comment&quot;&gt;// or only 'pass' =&amp;gt; in last revision
&lt;/span&gt;        &lt;span
class=&quot;php-quote&quot;&gt;'email'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-var&quot;&gt;$email&lt;/span&gt;,
);&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Mon, 25 May 2009 01:36:16 +0200</pubDate>
</item>
<item>
	<title>SQL Function in query (General Discussion)</title>
	<dc:creator>gotisch</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2435#p2435</link>
	<guid isPermaLink="false">2435@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;how can i add a SQL function that takes parameters in the query?&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; CreateUser(&lt;span
class=&quot;php-var&quot;&gt;$username&lt;/span&gt;, &lt;span class=&quot;php-var&quot;&gt;$email&lt;/span&gt;, &lt;span
class=&quot;php-var&quot;&gt;$password&lt;/span&gt;)
{
        &lt;span
class=&quot;php-var&quot;&gt;$connection&lt;/span&gt; = dibi::getConnection(&lt;span
class=&quot;php-quote&quot;&gt;'Server'&lt;/span&gt;);
        &lt;span
class=&quot;php-var&quot;&gt;$insert&lt;/span&gt; = &lt;span
class=&quot;php-keyword1&quot;&gt;array&lt;/span&gt;(
                &lt;span
class=&quot;php-quote&quot;&gt;'username'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$username&lt;/span&gt;),
                &lt;span
class=&quot;php-quote&quot;&gt;'pass'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;SHA1('&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$username&lt;/span&gt;) . &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$password&lt;/span&gt;) . &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;')&amp;quot;&lt;/span&gt;,
                &lt;span
class=&quot;php-quote&quot;&gt;'email'&lt;/span&gt; =&amp;gt; &lt;span
class=&quot;php-var&quot;&gt;$email&lt;/span&gt;,
        );
        &lt;span
class=&quot;php-var&quot;&gt;$connection&lt;/span&gt;-&amp;gt;query(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;INSERT INTO users &amp;quot;&lt;/span&gt;, &lt;span
class=&quot;php-var&quot;&gt;$insert&lt;/span&gt;);
        &lt;span
class=&quot;php-keyword1&quot;&gt;return&lt;/span&gt;;
}
CreateUser(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;test&amp;quot;&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;test@hotmail.com&amp;quot;&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;mypass123'%=,.&amp;quot;&lt;/span&gt;);
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The problem is with the pass. If i just add the string it will esacpe the
SHA1(' part too. SHA(\\' so in the end i end up with loads of \\ and the query
not working.&lt;/p&gt;

&lt;p&gt;if i do&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-keyword1&quot;&gt;new&lt;/span&gt; DibiVariable(&lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;SHA1('&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$username&lt;/span&gt;) . &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt; . &lt;span
class=&quot;php-keyword2&quot;&gt;strtoupper&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$password&lt;/span&gt;) . &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;')&amp;quot;&lt;/span&gt;, &lt;span
class=&quot;php-quote&quot;&gt;&amp;quot;sql&amp;quot;&lt;/span&gt;),
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;instead, it will not get escaped. And i can't use
$connection-&amp;gt;getDriver()-&amp;gt;escape($username,dibi::TEXT) because that
require a connection to the server already established, and i want the
connection setting lazy = true&lt;/p&gt;

&lt;p&gt;Thanks for any help!&lt;/p&gt;</description>
	<pubDate>Sat, 23 May 2009 03:22:13 +0200</pubDate>
</item>
<item>
	<title>Writing code in forum (Miscellaneous)</title>
	<dc:creator>David Grudl</dc:creator>
	<link>http://forum.dibiphp.com/en/viewtopic.php?pid=2434#p2434</link>
	<guid isPermaLink="false">2434@http://forum.dibiphp.com/en</guid>
	<description>&lt;p&gt;While posting and replying, you can use &lt;a
href=&quot;http://texy.info/en/syntax&quot;&gt;Texy syntax&lt;/a&gt; to enhance your messages.&lt;/p&gt;

&lt;p&gt;Code phrases can be surrounded by `backtick quotes`.&lt;/p&gt;

&lt;p&gt;Long code blocks write this way:&lt;/p&gt;

&lt;pre
class=&quot;src-texy&quot;&gt;&lt;code&gt;/--php
function importFile($m)
{
    list(, $file) = $m;
    $level = substr_count($file, '/');
    echo &amp;quot;$file\n&amp;quot;;
}
\--

or&lt;/code&gt;&lt;/pre&gt;

&lt;pre
class=&quot;src-texy&quot;&gt;&lt;code&gt;/--
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule .* $0.php [L]
\--&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It is possible to use &lt;code&gt;&amp;lt;?php&lt;/code&gt; and &lt;code&gt;?&amp;gt;&lt;/code&gt; delimiters
to indicate a PHP code:&lt;/p&gt;

&lt;pre class=&quot;src-php&quot;&gt;&lt;code&gt;&lt;span class=&quot;xlang&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span
class=&quot;php-keyword1&quot;&gt;function&lt;/span&gt; importFile(&lt;span
class=&quot;php-var&quot;&gt;$m&lt;/span&gt;)
{
    &lt;span class=&quot;php-keyword1&quot;&gt;list&lt;/span&gt;(, &lt;span
class=&quot;php-var&quot;&gt;$file&lt;/span&gt;) = &lt;span class=&quot;php-var&quot;&gt;$m&lt;/span&gt;;
    &lt;span
class=&quot;php-var&quot;&gt;$level&lt;/span&gt; = &lt;span
class=&quot;php-keyword2&quot;&gt;substr_count&lt;/span&gt;(&lt;span
class=&quot;php-var&quot;&gt;$file&lt;/span&gt;, &lt;span class=&quot;php-quote&quot;&gt;'/'&lt;/span&gt;);
    &lt;span
class=&quot;php-keyword1&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;php-quote&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span
class=&quot;php-var&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;php-quote&quot;&gt;\n&amp;quot;&lt;/span&gt;;
}
&lt;span
class=&quot;xlang&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;JavaScript delimites are supported too (the &lt;code&gt;type&lt;/code&gt; attribute is
optional):&lt;/p&gt;

&lt;pre class=&quot;src-html&quot;&gt;&lt;code&gt;&lt;span class=&quot;html-tag&quot;&gt;&amp;lt;script&lt;/span&gt;&lt;span
class=&quot;html-tagin&quot;&gt; type=&lt;/span&gt;&lt;span
class=&quot;html-quote&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;js-out&quot;&gt;
&lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;function&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; queryMark(url) {
  &lt;/span&gt;&lt;span
class=&quot;js-keywords1&quot;&gt;return&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; (url.indexOf(&lt;/span&gt;&lt;span class=&quot;js-quote&quot;&gt;'?'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;) == -&lt;/span&gt;&lt;span class=&quot;js-num&quot;&gt;1&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;) ? &lt;/span&gt;&lt;span class=&quot;js-quote&quot;&gt;'?'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;js-quote&quot;&gt;'&amp;amp;'&lt;/span&gt;&lt;span
class=&quot;js-out&quot;&gt;;
}
&lt;/span&gt;&lt;span
class=&quot;html-tag&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description>
	<pubDate>Mon, 01 Sep 2008 01:52:50 +0200</pubDate>
</item>
</channel>
</rss>

