<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-161</id>
	<title>Nabble - Php - Database</title>
	<updated>2009-12-10T13:02:44Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Php---Database-f161.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Php---Database-f161.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26734928</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T13:02:44Z</published>
	<updated>2009-12-10T13:02:44Z</updated>
	<author>
		<name>christopher jones-10</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;Sara Leavitt wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; How about combining &amp;nbsp;MySQLi with mysql_pconnect? &amp;nbsp;Assuming both are
&lt;br&gt;&amp;nbsp;&amp;gt; persistent, would those connections be shared?
&lt;br&gt;&amp;nbsp;&amp;gt; The goal here is to use prepared statements. I read that MySQLi only
&lt;br&gt;&amp;nbsp;&amp;gt; supports persistent connections in php version 5.3 which we are not yet
&lt;br&gt;&amp;nbsp;&amp;gt; running, but perhaps it would be worth waiting for 5.3.
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; -Sara
&lt;br&gt;&lt;br&gt;The mysqli extension appears to use &amp;quot;mysqli_&amp;quot; as the hash key prefix
&lt;br&gt;so there won't be PHP connection structure sharing here either.
&lt;br&gt;&lt;br&gt;Chris
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; Christopher Jones wrote:
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; Andy Shellam (Mailing Lists) wrote:
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; &amp;quot;First, when connecting, the function would first try to find a
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; (persistent) link that's already open with the same host, username
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; and password. If one is found, an identifier for it will be returned
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; instead of opening a new connection.&amp;quot;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; Therefore, providing you've configured PHP's --with-mysql and
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; --with-pdo-mysql options with the same MySQL library, then as long
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; as the host, username and password are the same, the same connection
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; will be re-used for both the native (mysql_pconnect) connection and
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; &amp;gt; the PDO connection.
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; The doc refers to the PHP end of the connection and only to any
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; existing PDO connection. &amp;nbsp;PDO uses a hash table for open connections
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; which it scans for matches when a PDO connection call is executed.
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; The hash key is unique and begins with &amp;quot;PDO:DBH:DSN=&amp;quot;. &amp;nbsp;The mysql
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; extension uses &amp;quot;mysql_&amp;quot; for its hash key prefix. &amp;nbsp;This mean the PHP
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; data structures for persistent connections won't be shared between the
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; two extensions.
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; Whether the MySQL client library or the MySQL database reuses any
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; connection data underneath, I don't know. &amp;nbsp;In Oracle the answer would
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; be that PDO_OCI and OCI8 connections are distinct and transactionally
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; separate (though they could share the same database connection pool if
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; one was enabled).
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt; Chris
&lt;br&gt;&amp;nbsp;&amp;gt;&amp;gt;
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Blog: &lt;a href=&quot;http://blogs.oracle.com/opal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blogs.oracle.com/opal&lt;/a&gt;&lt;br&gt;Twitter: &amp;nbsp;&lt;a href=&quot;http://twitter.com/ghrd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/ghrd&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26734928.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26733782</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T12:11:53Z</published>
	<updated>2009-12-10T12:11:53Z</updated>
	<author>
		<name>Sara Leavitt</name>
	</author>
	<content type="html">How about combining &amp;nbsp;MySQLi with mysql_pconnect? &amp;nbsp;Assuming both are 
&lt;br&gt;persistent, would those connections be shared? 
&lt;br&gt;&lt;br&gt;The goal here is to use prepared statements. I read that MySQLi only 
&lt;br&gt;supports persistent connections in php version 5.3 which we are not yet 
&lt;br&gt;running, but perhaps it would be worth waiting for 5.3.
&lt;br&gt;&lt;br&gt;-Sara
&lt;br&gt;&lt;br&gt;&lt;br&gt;Christopher Jones wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andy Shellam (Mailing Lists) wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;First, when connecting, the function would first try to find a
&lt;br&gt;&amp;gt; &amp;gt; (persistent) link that's already open with the same host, username
&lt;br&gt;&amp;gt; &amp;gt; and password. If one is found, an identifier for it will be returned
&lt;br&gt;&amp;gt; &amp;gt; instead of opening a new connection.&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Therefore, providing you've configured PHP's --with-mysql and
&lt;br&gt;&amp;gt; &amp;gt; --with-pdo-mysql options with the same MySQL library, then as long
&lt;br&gt;&amp;gt; &amp;gt; as the host, username and password are the same, the same connection
&lt;br&gt;&amp;gt; &amp;gt; will be re-used for both the native (mysql_pconnect) connection and
&lt;br&gt;&amp;gt; &amp;gt; the PDO connection.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The doc refers to the PHP end of the connection and only to any
&lt;br&gt;&amp;gt; existing PDO connection. &amp;nbsp;PDO uses a hash table for open connections
&lt;br&gt;&amp;gt; which it scans for matches when a PDO connection call is executed.
&lt;br&gt;&amp;gt; The hash key is unique and begins with &amp;quot;PDO:DBH:DSN=&amp;quot;. &amp;nbsp;The mysql
&lt;br&gt;&amp;gt; extension uses &amp;quot;mysql_&amp;quot; for its hash key prefix. &amp;nbsp;This mean the PHP
&lt;br&gt;&amp;gt; data structures for persistent connections won't be shared between the
&lt;br&gt;&amp;gt; two extensions.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Whether the MySQL client library or the MySQL database reuses any
&lt;br&gt;&amp;gt; connection data underneath, I don't know. &amp;nbsp;In Oracle the answer would
&lt;br&gt;&amp;gt; be that PDO_OCI and OCI8 connections are distinct and transactionally
&lt;br&gt;&amp;gt; separate (though they could share the same database connection pool if
&lt;br&gt;&amp;gt; one was enabled).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Chris
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26733782.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26733466</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T11:47:53Z</published>
	<updated>2009-12-10T11:47:53Z</updated>
	<author>
		<name>christopher jones-10</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;Andy Shellam (Mailing Lists) wrote:
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;quot;First, when connecting, the function would first try to find a
&lt;br&gt;&amp;nbsp;&amp;gt; (persistent) link that's already open with the same host, username
&lt;br&gt;&amp;nbsp;&amp;gt; and password. If one is found, an identifier for it will be returned
&lt;br&gt;&amp;nbsp;&amp;gt; instead of opening a new connection.&amp;quot;
&lt;br&gt;&amp;nbsp;&amp;gt;
&lt;br&gt;&amp;nbsp;&amp;gt; Therefore, providing you've configured PHP's --with-mysql and
&lt;br&gt;&amp;nbsp;&amp;gt; --with-pdo-mysql options with the same MySQL library, then as long
&lt;br&gt;&amp;nbsp;&amp;gt; as the host, username and password are the same, the same connection
&lt;br&gt;&amp;nbsp;&amp;gt; will be re-used for both the native (mysql_pconnect) connection and
&lt;br&gt;&amp;nbsp;&amp;gt; the PDO connection.
&lt;br&gt;&lt;br&gt;The doc refers to the PHP end of the connection and only to any
&lt;br&gt;existing PDO connection. &amp;nbsp;PDO uses a hash table for open connections
&lt;br&gt;which it scans for matches when a PDO connection call is executed.
&lt;br&gt;The hash key is unique and begins with &amp;quot;PDO:DBH:DSN=&amp;quot;. &amp;nbsp;The mysql
&lt;br&gt;extension uses &amp;quot;mysql_&amp;quot; for its hash key prefix. &amp;nbsp;This mean the PHP
&lt;br&gt;data structures for persistent connections won't be shared between the
&lt;br&gt;two extensions.
&lt;br&gt;&lt;br&gt;Whether the MySQL client library or the MySQL database reuses any
&lt;br&gt;connection data underneath, I don't know. &amp;nbsp;In Oracle the answer would
&lt;br&gt;be that PDO_OCI and OCI8 connections are distinct and transactionally
&lt;br&gt;separate (though they could share the same database connection pool if
&lt;br&gt;one was enabled).
&lt;br&gt;&lt;br&gt;Chris
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Blog: &lt;a href=&quot;http://blogs.oracle.com/opal&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blogs.oracle.com/opal&lt;/a&gt;&lt;br&gt;Twitter: &amp;nbsp;&lt;a href=&quot;http://twitter.com/ghrd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/ghrd&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26733466.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26733034</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T11:22:32Z</published>
	<updated>2009-12-10T11:22:32Z</updated>
	<author>
		<name>Andy Shellam (Mailing Lists)-2</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; One thing to be careful is if you are relying on 'transactions' to handle anything. Obviously the transaction has to be in the same connection just to work. Despite what others have said, the PDO connection will be different to the generic mysql connection as it is a separate process. Persistent connections will only reuse an already open connection, you can't connect two processes to the same connection. You would not know which process was accessing things.
&lt;br&gt;&lt;br&gt;According to the documentation:
&lt;br&gt;&lt;br&gt;&amp;quot;First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection.&amp;quot;
&lt;br&gt;&lt;br&gt;Therefore, providing you've configured PHP's --with-mysql and --with-pdo-mysql options with the same MySQL library, then as long as the host, username and password are the same, the same connection will be re-used for both the native (mysql_pconnect) connection and the PDO connection.
&lt;br&gt;&lt;br&gt;I'm not sure about the mysqli library, but I believe that lies beneath the mysql_* family of functions anyway so it shouldn't make a difference whether you're using libmysqlclient or mysqli.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Andy</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26733034.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26732451</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T10:43:22Z</published>
	<updated>2009-12-10T10:43:22Z</updated>
	<author>
		<name>Lester Caine</name>
	</author>
	<content type="html">Sara Leavitt wrote:
&lt;br&gt;&amp;gt; So I can see that using two connections for updating might get out of 
&lt;br&gt;&amp;gt; synch; however, mixing the connections should be OK for a series of 
&lt;br&gt;&amp;gt; SELECT queries on the read-only side of the application, right?
&lt;br&gt;&lt;br&gt;Yes &amp;nbsp;- if you are only reading already stored data there should not be a problem.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -Sara
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Lester Caine wrote:
&lt;br&gt;&amp;gt;&amp;gt; Sara Leavitt wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hi Lester,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; etc.), so I think we are safe there. &amp;nbsp;Are you saying that even if 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; both the mysql_pconnect &amp;nbsp;and PDO connection are persistent that they 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; will be completely separate? &amp;nbsp;(Havn't had a chance to test this 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; empirically just yet.)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Yes ... I'm not totally sure about how MySQL works by default, but 
&lt;br&gt;&amp;gt;&amp;gt; having 'committed' data on one connection, one would need to refresh 
&lt;br&gt;&amp;gt;&amp;gt; the other connection possibly to see that data. Firebird is a lot more 
&lt;br&gt;&amp;gt;&amp;gt; manageable on transaction control, and basically data entered on on 
&lt;br&gt;&amp;gt;&amp;gt; connection will not be visible on the other until properly committed. 
&lt;br&gt;&amp;gt;&amp;gt; Having that activity hidden in the drivers can lead to a little 
&lt;br&gt;&amp;gt;&amp;gt; 'confusion' as to what state data is actually in ....
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Even just opening two connections via the MySQL driver will have the 
&lt;br&gt;&amp;gt;&amp;gt; same effect.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;Lester Caine - G8HFL
&lt;br&gt;-----------------------------
&lt;br&gt;Contact - &lt;a href=&quot;http://lsces.co.uk/wiki/?page=contact&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk/wiki/?page=contact&lt;/a&gt;&lt;br&gt;L.S.Caine Electronic Services - &lt;a href=&quot;http://lsces.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk&lt;/a&gt;&lt;br&gt;EnquirySolve - &lt;a href=&quot;http://enquirysolve.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enquirysolve.com/&lt;/a&gt;&lt;br&gt;Model Engineers Digital Workshop - &lt;a href=&quot;http://medw.co.uk//&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://medw.co.uk//&lt;/a&gt;&lt;br&gt;Firebird - &lt;a href=&quot;http://www.firebirdsql.org/index.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.firebirdsql.org/index.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26732451.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26731856</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T10:00:02Z</published>
	<updated>2009-12-10T10:00:02Z</updated>
	<author>
		<name>Sara Leavitt</name>
	</author>
	<content type="html">So I can see that using two connections for updating might get out of 
&lt;br&gt;synch; however, mixing the connections should be OK for a series of 
&lt;br&gt;SELECT queries on the read-only side of the application, right?
&lt;br&gt;&lt;br&gt;-Sara
&lt;br&gt;&lt;br&gt;Lester Caine wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Sara Leavitt wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hi Lester,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
&lt;br&gt;&amp;gt;&amp;gt; etc.), so I think we are safe there. &amp;nbsp;Are you saying that even if 
&lt;br&gt;&amp;gt;&amp;gt; both the mysql_pconnect &amp;nbsp;and PDO connection are persistent that they 
&lt;br&gt;&amp;gt;&amp;gt; will be completely separate? &amp;nbsp;(Havn't had a chance to test this 
&lt;br&gt;&amp;gt;&amp;gt; empirically just yet.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yes ... I'm not totally sure about how MySQL works by default, but 
&lt;br&gt;&amp;gt; having 'committed' data on one connection, one would need to refresh 
&lt;br&gt;&amp;gt; the other connection possibly to see that data. Firebird is a lot more 
&lt;br&gt;&amp;gt; manageable on transaction control, and basically data entered on on 
&lt;br&gt;&amp;gt; connection will not be visible on the other until properly committed. 
&lt;br&gt;&amp;gt; Having that activity hidden in the drivers can lead to a little 
&lt;br&gt;&amp;gt; 'confusion' as to what state data is actually in ....
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Even just opening two connections via the MySQL driver will have the 
&lt;br&gt;&amp;gt; same effect.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26731856.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26731667</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T09:47:22Z</published>
	<updated>2009-12-10T09:47:22Z</updated>
	<author>
		<name>Lester Caine</name>
	</author>
	<content type="html">Sara Leavitt wrote:
&lt;br&gt;&amp;gt; Hi Lester,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
&lt;br&gt;&amp;gt; etc.), so I think we are safe there. &amp;nbsp;Are you saying that even if both 
&lt;br&gt;&amp;gt; the mysql_pconnect &amp;nbsp;and PDO connection are persistent that they will be 
&lt;br&gt;&amp;gt; completely separate? &amp;nbsp;(Havn't had a chance to test this empirically just 
&lt;br&gt;&amp;gt; yet.)
&lt;br&gt;&lt;br&gt;Yes ... I'm not totally sure about how MySQL works by default, but having 
&lt;br&gt;'committed' data on one connection, one would need to refresh the other 
&lt;br&gt;connection possibly to see that data. Firebird is a lot more manageable on 
&lt;br&gt;transaction control, and basically data entered on on connection will not be 
&lt;br&gt;visible on the other until properly committed. Having that activity hidden in 
&lt;br&gt;the drivers can lead to a little 'confusion' as to what state data is actually 
&lt;br&gt;in ....
&lt;br&gt;&lt;br&gt;Even just opening two connections via the MySQL driver will have the same effect.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Lester Caine - G8HFL
&lt;br&gt;-----------------------------
&lt;br&gt;Contact - &lt;a href=&quot;http://lsces.co.uk/wiki/?page=contact&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk/wiki/?page=contact&lt;/a&gt;&lt;br&gt;L.S.Caine Electronic Services - &lt;a href=&quot;http://lsces.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk&lt;/a&gt;&lt;br&gt;EnquirySolve - &lt;a href=&quot;http://enquirysolve.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enquirysolve.com/&lt;/a&gt;&lt;br&gt;Model Engineers Digital Workshop - &lt;a href=&quot;http://medw.co.uk//&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://medw.co.uk//&lt;/a&gt;&lt;br&gt;Firebird - &lt;a href=&quot;http://www.firebirdsql.org/index.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.firebirdsql.org/index.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26731667.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26731377</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T09:30:52Z</published>
	<updated>2009-12-10T09:30:52Z</updated>
	<author>
		<name>Sara Leavitt</name>
	</author>
	<content type="html">Hi Lester,
&lt;br&gt;&lt;br&gt;Our application is not using php transactions (e.g., COMMIT, ROLLBACK 
&lt;br&gt;etc.), so I think we are safe there. &amp;nbsp;Are you saying that even if both 
&lt;br&gt;the mysql_pconnect &amp;nbsp;and PDO connection are persistent that they will be 
&lt;br&gt;completely separate? &amp;nbsp;(Havn't had a chance to test this empirically just 
&lt;br&gt;yet.)
&lt;br&gt;&lt;br&gt;Thanks, Sara
&lt;br&gt;&lt;br&gt;Lester Caine wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Sara Leavitt wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; We are about to convert all of our queries using mysql_pconnect to
&lt;br&gt;&amp;gt;&amp;gt; prepared statements using PDO database connections. &amp;nbsp;It will take some
&lt;br&gt;&amp;gt;&amp;gt; time to convert the hundreds of SQL statements so the plan is to do it
&lt;br&gt;&amp;gt;&amp;gt; in phases. &amp;nbsp;Is it a bad idea to have both a mysql_pconnect and a PDO
&lt;br&gt;&amp;gt;&amp;gt; connection open for the same application? &amp;nbsp;Will this doubling of our
&lt;br&gt;&amp;gt;&amp;gt; database connections for every page hit degrade performance? &amp;nbsp; Any tips
&lt;br&gt;&amp;gt;&amp;gt; on the best way to transition to PDO/prepared statements with minimal
&lt;br&gt;&amp;gt;&amp;gt; disruption?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One thing to be careful is if you are relying on 'transactions' to 
&lt;br&gt;&amp;gt; handle anything. Obviously the transaction has to be in the same 
&lt;br&gt;&amp;gt; connection just to work. Despite what others have said, the PDO 
&lt;br&gt;&amp;gt; connection will be different to the generic mysql connection as it is 
&lt;br&gt;&amp;gt; a separate process. Persistent connections will only reuse an already 
&lt;br&gt;&amp;gt; open connection, you can't connect two processes to the same 
&lt;br&gt;&amp;gt; connection. You would not know which process was accessing things.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Sara Leavitt, UC Berkeley Event Calendar Coordinator
&lt;br&gt;Public Affairs, University of California
&lt;br&gt;2200 Bancroft Way
&lt;br&gt;Berkeley, CA 94720-4204
&lt;br&gt;Phone: 510 643-6163
&lt;br&gt;&lt;a href=&quot;http://events.berkeley.edu&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://events.berkeley.edu&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26731377.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26723587</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-10T00:21:14Z</published>
	<updated>2009-12-10T00:21:14Z</updated>
	<author>
		<name>Lester Caine</name>
	</author>
	<content type="html">Sara Leavitt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; We are about to convert all of our queries using mysql_pconnect to
&lt;br&gt;&amp;gt; prepared statements using PDO database connections. &amp;nbsp;It will take some
&lt;br&gt;&amp;gt; time to convert the hundreds of SQL statements so the plan is to do it
&lt;br&gt;&amp;gt; in phases. &amp;nbsp;Is it a bad idea to have both a mysql_pconnect and a PDO
&lt;br&gt;&amp;gt; connection open for the same application? &amp;nbsp;Will this doubling of our
&lt;br&gt;&amp;gt; database connections for every page hit degrade performance? &amp;nbsp; Any tips
&lt;br&gt;&amp;gt; on the best way to transition to PDO/prepared statements with minimal
&lt;br&gt;&amp;gt; disruption?
&lt;/div&gt;&lt;br&gt;One thing to be careful is if you are relying on 'transactions' to handle 
&lt;br&gt;anything. Obviously the transaction has to be in the same connection just to 
&lt;br&gt;work. Despite what others have said, the PDO connection will be different to the 
&lt;br&gt;generic mysql connection as it is a separate process. Persistent connections 
&lt;br&gt;will only reuse an already open connection, you can't connect two processes to 
&lt;br&gt;the same connection. You would not know which process was accessing things.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Lester Caine - G8HFL
&lt;br&gt;-----------------------------
&lt;br&gt;Contact - &lt;a href=&quot;http://lsces.co.uk/wiki/?page=contact&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk/wiki/?page=contact&lt;/a&gt;&lt;br&gt;L.S.Caine Electronic Services - &lt;a href=&quot;http://lsces.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lsces.co.uk&lt;/a&gt;&lt;br&gt;EnquirySolve - &lt;a href=&quot;http://enquirysolve.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enquirysolve.com/&lt;/a&gt;&lt;br&gt;Model Engineers Digital Workshop - &lt;a href=&quot;http://medw.co.uk//&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://medw.co.uk//&lt;/a&gt;&lt;br&gt;Firebird - &lt;a href=&quot;http://www.firebirdsql.org/index.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.firebirdsql.org/index.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26723587.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26719006</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-09T14:36:23Z</published>
	<updated>2009-12-09T14:36:23Z</updated>
	<author>
		<name>Andy Shellam (Mailing Lists)-2</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; As long as you test it (hopefully using some sort of automated tests) you should be right.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Since you're using persistent connections (make sure you set pdo to do the same), I don't think you're really doubling the number of connections.
&lt;br&gt;&lt;br&gt;Yeah, I think PDO uses the underlying mysql/pgsql functions anyway - it just provides a common API layer across all database types.
&lt;br&gt;&lt;br&gt;Therefore if you call mysql_pconnect outside of PDO, then call the same database server with PDO, technically it should realise the connection has already been made to that server and use your previous connection.
&lt;br&gt;&lt;br&gt;As Chris pointed out, make sure PDO will also use persistent connections.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Andy
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26719006.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26718712</id>
	<title>Re: Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-09T14:12:05Z</published>
	<updated>2009-12-09T14:12:05Z</updated>
	<author>
		<name>chris smith-9</name>
	</author>
	<content type="html">Sara Leavitt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; We are about to convert all of our queries using mysql_pconnect to
&lt;br&gt;&amp;gt; prepared statements using PDO database connections. &amp;nbsp;It will take some
&lt;br&gt;&amp;gt; time to convert the hundreds of SQL statements so the plan is to do it
&lt;br&gt;&amp;gt; in phases. &amp;nbsp;Is it a bad idea to have both a mysql_pconnect and a PDO
&lt;br&gt;&amp;gt; connection open for the same application? &amp;nbsp;Will this doubling of our
&lt;br&gt;&amp;gt; database connections for every page hit degrade performance? &amp;nbsp; Any tips
&lt;br&gt;&amp;gt; on the best way to transition to PDO/prepared statements with minimal
&lt;br&gt;&amp;gt; disruption?
&lt;/div&gt;&lt;br&gt;As long as you test it (hopefully using some sort of automated tests) 
&lt;br&gt;you should be right.
&lt;br&gt;&lt;br&gt;Since you're using persistent connections (make sure you set pdo to do 
&lt;br&gt;the same), I don't think you're really doubling the number of connections.
&lt;br&gt;&lt;br&gt;Check your mysql logs to see if you are doing double connections or not 
&lt;br&gt;- that way you'll know for sure.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Postgresql &amp; php tutorials
&lt;br&gt;&lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26718712.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26718662</id>
	<title>Re: Group by</title>
	<published>2009-12-09T14:09:19Z</published>
	<updated>2009-12-09T14:09:19Z</updated>
	<author>
		<name>chris smith-9</name>
	</author>
	<content type="html">Philip Thompson wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Dec 9, 2009, at 12:58 PM, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26718662&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;host@...&lt;/a&gt; wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; The only SELECT is on MAX('timestamp'). &amp;nbsp;There is really nothing to Group BY in this query.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Dewey
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Philip Thompson wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hi.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;/div&gt;&lt;br&gt;You won't with only 10 rows in the table.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; SELECT MAX(`timestamp`) AS `max_ts` FROM `history` WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; GROUP BY `history_field`
&lt;br&gt;&lt;br&gt;I'd index
&lt;br&gt;req_id, history_record_id, history_field, timestamp
&lt;br&gt;&lt;br&gt;If you're using myisam tables then all the data can be fetched directly 
&lt;br&gt;from the index instead of hitting the data table as well. If you're 
&lt;br&gt;using innodb, it'll at least use this index to search for req_id and 
&lt;br&gt;history_record_id (assuming these fields are normally in your queries).
&lt;br&gt;&lt;br&gt;&amp;gt; There's only 10 records in table right now... but the # of rows it's going to traverse before find the results is very small. 
&lt;br&gt;&lt;br&gt;In theory. Sometimes databases don't work that way and instead of 
&lt;br&gt;choosing a particular index you'd expect it to, it'll pick another one. 
&lt;br&gt;Fill up the table(s) and make sure it does what you expect. Mysql isn't 
&lt;br&gt;great at subselects either.
&lt;br&gt;&lt;br&gt;&amp;gt; Do I need to include `history_field` in the inner select?
&lt;br&gt;&lt;br&gt;No, you don't have to.
&lt;br&gt;&lt;br&gt;You could do a query like:
&lt;br&gt;&lt;br&gt;select count(id) from table group by another_field;
&lt;br&gt;&lt;br&gt;so you get a count per another_field of how many records there are. Not 
&lt;br&gt;a great example as normally you would include another_field in the 
&lt;br&gt;select, but you don't have to.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Postgresql &amp; php tutorials
&lt;br&gt;&lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26718662.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26716548</id>
	<title>Re: Group by</title>
	<published>2009-12-09T11:49:44Z</published>
	<updated>2009-12-09T11:49:44Z</updated>
	<author>
		<name>Philip Thompson-4</name>
	</author>
	<content type="html">On Dec 9, 2009, at 12:58 PM, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26716548&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;host@...&lt;/a&gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The only SELECT is on MAX('timestamp'). &amp;nbsp;There is really nothing to Group BY in this query.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Dewey
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Philip Thompson wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hi.
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; SELECT MAX(`timestamp`) AS `max_ts` FROM `history` WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt;&amp;gt; GROUP BY `history_field`
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;&amp;gt; ~Philip
&lt;/div&gt;&lt;br&gt;Well, that was just an example query. My real one is....
&lt;br&gt;&lt;br&gt;SELECT `h`.*
&lt;br&gt;FROM (
&lt;br&gt;&amp;nbsp; &amp;nbsp; SELECT MAX(`history_timestamp`) AS `max_ts`
&lt;br&gt;&amp;nbsp; &amp;nbsp; FROM `history`
&lt;br&gt;&amp;nbsp; &amp;nbsp; WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;nbsp; &amp;nbsp; GROUP BY `history_field`
&lt;br&gt;) AS `max`
&lt;br&gt;&amp;nbsp; &amp;nbsp; INNER JOIN `history` `h` ON `max`.`max_ts` = `h`.`history_timestamp`
&lt;br&gt;WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;GROUP BY `history_field`
&lt;br&gt;&lt;br&gt;This returns the results I need. The explain (split up) from this query is...
&lt;br&gt;&lt;br&gt;+----+-------------+------------+------+--------------------------------------------+
&lt;br&gt;| id | select_type | table &amp;nbsp; &amp;nbsp; &amp;nbsp;| type | possible_keys &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|
&lt;br&gt;+----+-------------+------------+------+--------------------------------------------+
&lt;br&gt;| &amp;nbsp;1 | PRIMARY &amp;nbsp; &amp;nbsp; | h &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| ref &amp;nbsp;| req_id_history_record_id,history_timestamp |
&lt;br&gt;| &amp;nbsp;1 | PRIMARY &amp;nbsp; &amp;nbsp; | &amp;lt;derived2&amp;gt; | ALL &amp;nbsp;| NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |
&lt;br&gt;| &amp;nbsp;2 | DERIVED &amp;nbsp; &amp;nbsp; | history &amp;nbsp; &amp;nbsp;| ref &amp;nbsp;| req_id_history_record_id &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |
&lt;br&gt;+----+-------------+------------+------+--------------------------------------------+
&lt;br&gt;&lt;br&gt;--------------------------+---------+-------------+------+----------------------------------------------+
&lt;br&gt;&amp;nbsp;key &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| key_len | ref &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | rows | Extra &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|
&lt;br&gt;--------------------------+---------+-------------+------+----------------------------------------------+
&lt;br&gt;&amp;nbsp;req_id_history_record_id | 8 &amp;nbsp; &amp;nbsp; &amp;nbsp; | const,const | &amp;nbsp; &amp;nbsp;3 | Using temporary; Using filesort &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|
&lt;br&gt;&amp;nbsp;NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | NULL &amp;nbsp; &amp;nbsp;| NULL &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;2 | Using where &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|
&lt;br&gt;&amp;nbsp;req_id_history_record_id | 8 &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;3 | Using where; Using temporary; Using filesort |
&lt;br&gt;--------------------------+---------+-------------+------+----------------------------------------------+ &amp;nbsp;
&lt;br&gt;3 rows in set (0.01 sec)
&lt;br&gt;&lt;br&gt;There's only 10 records in table right now... but the # of rows it's going to traverse before find the results is very small. 
&lt;br&gt;&lt;br&gt;Do I need to include `history_field` in the inner select?
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;~Philip</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26716548.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26715910</id>
	<title>Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-09T11:11:50Z</published>
	<updated>2009-12-09T11:11:50Z</updated>
	<author>
		<name>Sara Leavitt</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;We are about to convert all of our queries using mysql_pconnect to
&lt;br&gt;prepared statements using PDO database connections. &amp;nbsp;It will take some
&lt;br&gt;time to convert the hundreds of SQL statements so the plan is to do it
&lt;br&gt;in phases. &amp;nbsp;Is it a bad idea to have both a mysql_pconnect and a PDO
&lt;br&gt;connection open for the same application? &amp;nbsp;Will this doubling of our
&lt;br&gt;database connections for every page hit degrade performance? &amp;nbsp; Any tips
&lt;br&gt;on the best way to transition to PDO/prepared statements with minimal
&lt;br&gt;disruption?
&lt;br&gt;&lt;br&gt;-Sara
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715910p26715910.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26715756</id>
	<title>Re: Group by</title>
	<published>2009-12-09T10:58:49Z</published>
	<updated>2009-12-09T10:58:49Z</updated>
	<author>
		<name>host@deweywilliams.com</name>
	</author>
	<content type="html">The only SELECT is on MAX('timestamp'). &amp;nbsp;There is really nothing to 
&lt;br&gt;Group BY in this query.
&lt;br&gt;&lt;br&gt;Dewey
&lt;br&gt;&lt;br&gt;Philip Thompson wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT MAX(`timestamp`) AS `max_ts` 
&lt;br&gt;&amp;gt; FROM `history` 
&lt;br&gt;&amp;gt; WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt; GROUP BY `history_field`
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; ~Philip
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26715756.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26715652</id>
	<title>Combing PDO with mysql_pconnect connections in one application -- will this degrade performance?</title>
	<published>2009-12-09T10:56:10Z</published>
	<updated>2009-12-09T10:56:10Z</updated>
	<author>
		<name>Sara Leavitt</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;We are about to convert all of our queries using mysql_pconnect to 
&lt;br&gt;prepared statements using PDO database connections. &amp;nbsp;It will take some 
&lt;br&gt;time to convert the hundreds of SQL statements so the plan is to do it 
&lt;br&gt;in phases. &amp;nbsp;Is is bad idea to have both a mysql_pconnect and a PDO 
&lt;br&gt;connection open for the same application? &amp;nbsp;Will this doubling of our 
&lt;br&gt;database connections for every page hit degrade performance? &amp;nbsp; Any tips 
&lt;br&gt;on the best way to transition to PDO/prepared statements with minimal 
&lt;br&gt;disruption?
&lt;br&gt;&lt;br&gt;-Sara
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Combing-PDO-with-mysql_pconnect-connections-in-one-application----will-this-degrade-performance--tp26715652p26715652.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26714636</id>
	<title>Re: Group by</title>
	<published>2009-12-09T09:56:11Z</published>
	<updated>2009-12-09T09:56:11Z</updated>
	<author>
		<name>Barry Stear</name>
	</author>
	<content type="html">Also you may not see a difference because your not even using
&lt;br&gt;'History_field' anywhere in your SELECT statement. I am a little surprised
&lt;br&gt;that you didn't receive a error.
&lt;br&gt;&lt;br&gt;On Wed, Dec 9, 2009 at 9:31 AM, Juan Pablo Ramirez &amp;lt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714636&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ramirez.juanpablo@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi i recommend always use indexes when programming. developers tend not
&lt;br&gt;&amp;gt; to.. and when the databases grows it's difficult to modify or make them
&lt;br&gt;&amp;gt; modify the code.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; El mié, 09-12-2009 a las 14:22 -0300, Julio Araya escribió:
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt; On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson &amp;lt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714636&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;philthathril@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Hi.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed?
&lt;br&gt;&amp;gt; Using EXPLAIN on one of my queries, I noticed no change between having
&lt;br&gt;&amp;gt; indexed by GROUP BY field and not indexing it. Any thoughts would be
&lt;br&gt;&amp;gt; appreciated.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; SELECT MAX(`timestamp`) AS `max_ts`
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; FROM `history`
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; GROUP BY `history_field`
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; always depends on how many records you have, if you have 100-1000
&lt;br&gt;&amp;gt; &amp;gt; records is very diferent to 100000-500000
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Thanks,
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; ~Philip
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt; Julio Araya C. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Linux User
&lt;br&gt;&amp;gt; #386141
&lt;br&gt;&amp;gt; &amp;gt; Memorista de Ingeniería Civil Informática &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Ubuntu User #14778
&lt;br&gt;&amp;gt; &amp;gt; Universidd Técnica Federico Santa María &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Valparaíso - Chile
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;lt;a href=&amp;quot;&lt;a href=&quot;http://www.c28.com/?adid=st&amp;iid=19467&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.c28.com/?adid=st&amp;iid=19467&lt;/a&gt;&amp;quot;&amp;gt;
&lt;br&gt;&amp;lt;img src=&amp;quot;&lt;a href=&quot;http://www.c28.com/images/banner_88x31.gif&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.c28.com/images/banner_88x31.gif&lt;/a&gt;&amp;quot; border=&amp;quot;0&amp;quot; width=&amp;quot;88&amp;quot;
&lt;br&gt;height=&amp;quot;31&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26714636.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26714215</id>
	<title>Re: Group by</title>
	<published>2009-12-09T09:31:07Z</published>
	<updated>2009-12-09T09:31:07Z</updated>
	<author>
		<name>Juan Pablo Ramirez-2</name>
	</author>
	<content type="html">Hi i recommend always use indexes when programming. developers tend not
&lt;br&gt;to.. and when the databases grows it's difficult to modify or make them
&lt;br&gt;modify the code.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;El mié, 09-12-2009 a las 14:22 -0300, Julio Araya escribió:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714215&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;philthathril@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hi.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; SELECT MAX(`timestamp`) AS `max_ts`
&lt;br&gt;&amp;gt; &amp;gt; FROM `history`
&lt;br&gt;&amp;gt; &amp;gt; WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt; &amp;gt; GROUP BY `history_field`
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; always depends on how many records you have, if you have 100-1000
&lt;br&gt;&amp;gt; records is very diferent to 100000-500000
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Thanks,
&lt;br&gt;&amp;gt; &amp;gt; ~Philip
&lt;br&gt;&amp;gt; &amp;gt; --
&lt;br&gt;&amp;gt; &amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; &amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; Julio Araya C. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Linux User #386141
&lt;br&gt;&amp;gt; Memorista de Ingeniería Civil Informática &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Ubuntu User #14778
&lt;br&gt;&amp;gt; Universidd Técnica Federico Santa María &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Valparaíso - Chile
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26714215.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26714043</id>
	<title>Re: Group by</title>
	<published>2009-12-09T09:22:21Z</published>
	<updated>2009-12-09T09:22:21Z</updated>
	<author>
		<name>Julio Araya</name>
	</author>
	<content type="html">On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714043&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;philthathril@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In this example, should `history_field` be indexed...?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; SELECT MAX(`timestamp`) AS `max_ts`
&lt;br&gt;&amp;gt; FROM `history`
&lt;br&gt;&amp;gt; WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;&amp;gt; GROUP BY `history_field`
&lt;/div&gt;&lt;br&gt;always depends on how many records you have, if you have 100-1000
&lt;br&gt;records is very diferent to 100000-500000
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; ~Philip
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Julio Araya C. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Linux User #386141
&lt;br&gt;Memorista de Ingeniería Civil Informática &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Ubuntu User #14778
&lt;br&gt;Universidd Técnica Federico Santa María &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Valparaíso - Chile
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26714043.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26712518</id>
	<title>Group by</title>
	<published>2009-12-09T07:52:31Z</published>
	<updated>2009-12-09T07:52:31Z</updated>
	<author>
		<name>Philip Thompson-4</name>
	</author>
	<content type="html">Hi.
&lt;br&gt;&lt;br&gt;In a mysql query, it is recommended that &amp;quot;GROUP BY&amp;quot; fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated.
&lt;br&gt;&lt;br&gt;In this example, should `history_field` be indexed...?
&lt;br&gt;&lt;br&gt;SELECT MAX(`timestamp`) AS `max_ts` 
&lt;br&gt;FROM `history` 
&lt;br&gt;WHERE `req_id` = 17 AND `history_record_id` = 35
&lt;br&gt;GROUP BY `history_field`
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;~Philip
&lt;br&gt;--
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Group-by-tp26712518p26712518.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26698766</id>
	<title>Re: Multiple MySQL schemas</title>
	<published>2009-12-08T10:51:49Z</published>
	<updated>2009-12-08T10:51:49Z</updated>
	<author>
		<name>Phpster</name>
	</author>
	<content type="html">On Tue, Dec 8, 2009 at 12:54 PM, Philip Thompson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26698766&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;philthathril@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; We are wanting to create an app that contains multiple clients. Each clients has anywhere from 1 user to more than a hundred. We had the idea of separating each client into its own database schema. This reduces the single point of failure - if 1 client db dies, it doesn't kill the others. This keeps the individual schemas smaller, which will allow us to asynchronously (for lack of a better word) transfer our backups to our network w/o causing bottlenecks. It also guarantees the separation of data (even though the application takes care of this, it's *that extra step*).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is it reasonable to create a new database per client? Or should we cluster several clients together (5-10) into a single database? What are the pros and cons of each? Note that some clients are *linked* and share data, so those would not be mutually exclusive. What is the maximum number of schemas per MySQL instance - I'm guessing this is based on the filesystem (RHEL)?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks in advance,
&lt;br&gt;&amp;gt; ~Philip
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Phil,
&lt;br&gt;&lt;br&gt;We do exactly that, having one db per client. As you say, it handles
&lt;br&gt;the separation of data. This should be the only reason to separate the
&lt;br&gt;dbs, if the data is sensitive enough to require that.
&lt;br&gt;&lt;br&gt;The one thing to think about is to create a different user for each DB
&lt;br&gt;instance to ensure that if someone compromises on DB that they can't
&lt;br&gt;automatically gain access to the others. Also ensure that the user
&lt;br&gt;account has the least required privileges needed to do the job. That
&lt;br&gt;may mean more account maintenance headaches for you, but will keep the
&lt;br&gt;data safer, as there is no need to have the user account have admin
&lt;br&gt;privileges on the db for any reason.
&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Bastien
&lt;br&gt;&lt;br&gt;Cat, the other other white meat
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Multiple-MySQL-schemas-tp26697873p26698766.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26697873</id>
	<title>Multiple MySQL schemas</title>
	<published>2009-12-08T09:54:25Z</published>
	<updated>2009-12-08T09:54:25Z</updated>
	<author>
		<name>Philip Thompson-4</name>
	</author>
	<content type="html">Hi all.
&lt;br&gt;&lt;br&gt;We are wanting to create an app that contains multiple clients. Each clients has anywhere from 1 user to more than a hundred. We had the idea of separating each client into its own database schema. This reduces the single point of failure - if 1 client db dies, it doesn't kill the others. This keeps the individual schemas smaller, which will allow us to asynchronously (for lack of a better word) transfer our backups to our network w/o causing bottlenecks. It also guarantees the separation of data (even though the application takes care of this, it's *that extra step*).
&lt;br&gt;&lt;br&gt;Is it reasonable to create a new database per client? Or should we cluster several clients together (5-10) into a single database? What are the pros and cons of each? Note that some clients are *linked* and share data, so those would not be mutually exclusive. What is the maximum number of schemas per MySQL instance - I'm guessing this is based on the filesystem (RHEL)?
&lt;br&gt;&lt;br&gt;Thanks in advance,
&lt;br&gt;~Philip
&lt;br&gt;--
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Multiple-MySQL-schemas-tp26697873p26697873.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26530858</id>
	<title>Re: unlink problems</title>
	<published>2009-11-26T07:15:17Z</published>
	<updated>2009-11-26T07:15:17Z</updated>
	<author>
		<name>Richard Quadling</name>
	</author>
	<content type="html">2009/11/25 Neil Jackson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26530858&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;neil@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;&amp;gt; Hash: SHA1
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; I use the following to delete a file on a webserver
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;        if( unlink( &amp;quot;./$filename&amp;quot; ) )
&lt;br&gt;&amp;gt;        {
&lt;br&gt;&amp;gt;                echo $filename.&amp;quot; deleted &amp;quot;;
&lt;br&gt;&amp;gt;                $action='';
&lt;br&gt;&amp;gt;                echo
&lt;br&gt;&amp;gt; &amp;quot;&amp;lt;script&amp;gt;document.location.href='$PHP_SELF?action=$action&amp;code=$code'&amp;lt;/script&amp;gt;&amp;quot;;
&lt;br&gt;&amp;gt;        }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But I get the following error
&lt;br&gt;&amp;gt; Warning: unlink(./6 November 2009.pdf): No such file or directory in
&lt;br&gt;&amp;gt; /srv/www/htdocs/bee_partners/admin/tenders.php on line 82 6 November
&lt;br&gt;&amp;gt; 2009.pdf not deleted
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any help?
&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNATURE-----
&lt;br&gt;&amp;gt; Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&amp;gt; Comment: Using GnuPG with SUSE - &lt;a href=&quot;http://enigmail.mozdev.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; iEYEARECAAYFAksNBV4ACgkQGgk1S8edB3JqWgCfb61pxGvh+KCXNfNdWgF2kb/P
&lt;br&gt;&amp;gt; xCMAn2dSOgN9AiFYX35Ga00XyxZQwGnw
&lt;br&gt;&amp;gt; =NL6k
&lt;br&gt;&amp;gt; -----END PGP SIGNATURE-----
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;Not exactly sure what help you would need? The file doesn't exist, so
&lt;br&gt;you can't delete it.
&lt;br&gt;&lt;br&gt;But a quick hack later ...
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.beepartners.com/tenders/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.beepartners.com/tenders/&lt;/a&gt;&lt;br&gt;&lt;br&gt;is where the files are and
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.beepartners.com/admin/tenders.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.beepartners.com/admin/tenders.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;is where the script it.
&lt;br&gt;&lt;br&gt;So, &amp;quot;./$filename&amp;quot; should probably be &amp;quot;../tenders/$filename&amp;quot; maybe.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Richard.
&lt;br&gt;-- 
&lt;br&gt;-----
&lt;br&gt;Richard Quadling
&lt;br&gt;&amp;quot;Standing on the shoulders of some very clever giants!&amp;quot;
&lt;br&gt;EE : &lt;a href=&quot;http://www.experts-exchange.com/M_248814.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.experts-exchange.com/M_248814.html&lt;/a&gt;&lt;br&gt;Zend Certified Engineer : &lt;a href=&quot;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&lt;/a&gt;&lt;br&gt;ZOPA : &lt;a href=&quot;http://uk.zopa.com/member/RQuadling&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://uk.zopa.com/member/RQuadling&lt;/a&gt;&lt;br&gt;&lt;br&gt;--
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/unlink-problems-tp26510353p26530858.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26524379</id>
	<title>Re: unlink problems</title>
	<published>2009-11-25T20:58:54Z</published>
	<updated>2009-11-25T20:58:54Z</updated>
	<author>
		<name>chris smith-9</name>
	</author>
	<content type="html">Gunawan Wibisono wrote:
&lt;br&gt;&amp;gt; kesavan is right !!
&lt;br&gt;&amp;gt; i see the problem in link..
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; u type &amp;quot;./blabla.pdf&amp;quot; the main problem is in the &amp;quot;./&amp;quot;
&lt;br&gt;&amp;gt; remove the &amp;quot;./&amp;quot;
&lt;br&gt;&amp;gt; unless the file you want to remove are in the root
&lt;br&gt;&lt;br&gt;./ means the current directory.
&lt;br&gt;&lt;br&gt;take that out - you still reference the current directory.
&lt;br&gt;&lt;br&gt;$ touch abc
&lt;br&gt;$ ls ./abc
&lt;br&gt;./abc
&lt;br&gt;$ ls abc
&lt;br&gt;abc
&lt;br&gt;&lt;br&gt;they are the same file.
&lt;br&gt;&lt;br&gt;Using a full path is the best because you always know what it will be 
&lt;br&gt;referencing.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Postgresql &amp; php tutorials
&lt;br&gt;&lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/unlink-problems-tp26510353p26524379.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26523884</id>
	<title>Re: unlink problems</title>
	<published>2009-11-25T19:24:54Z</published>
	<updated>2009-11-25T19:24:54Z</updated>
	<author>
		<name>gunawan-4</name>
	</author>
	<content type="html">kesavan is right !!
&lt;br&gt;i see the problem in link..
&lt;br&gt;&lt;br&gt;u type &amp;quot;./blabla.pdf&amp;quot; the main problem is in the &amp;quot;./&amp;quot;
&lt;br&gt;remove the &amp;quot;./&amp;quot;
&lt;br&gt;unless the file you want to remove are in the root
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On 11/25/09, Kesavan Rengarajan &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26523884&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;k7@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Looks like the PDF is not in the admin directory. Try to use the full
&lt;br&gt;&amp;gt; path to the PDF file and also check the permissions on the file.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sent from my iPhone
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On 25/11/2009, at 9:22 PM, Neil Jackson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26523884&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;neil@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; -----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;&amp;gt;&amp;gt; Hash: SHA1
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;&amp;gt; I use the following to delete a file on a webserver
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;if( unlink( &amp;quot;./$filename&amp;quot; ) )
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo $filename.&amp;quot; deleted &amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$action='';
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;&amp;lt;script&amp;gt;document.location.href='$PHP_SELF?action=$action&amp;code=
&lt;br&gt;&amp;gt;&amp;gt; $code'&amp;lt;/script&amp;gt;&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; But I get the following error
&lt;br&gt;&amp;gt;&amp;gt; Warning: unlink(./6 November 2009.pdf): No such file or directory in
&lt;br&gt;&amp;gt;&amp;gt; /srv/www/htdocs/bee_partners/admin/tenders.php on line 82 6 November
&lt;br&gt;&amp;gt;&amp;gt; 2009.pdf not deleted
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Any help?
&lt;br&gt;&amp;gt;&amp;gt; -----BEGIN PGP SIGNATURE-----
&lt;br&gt;&amp;gt;&amp;gt; Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&amp;gt;&amp;gt; Comment: Using GnuPG with SUSE - &lt;a href=&quot;http://enigmail.mozdev.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; iEYEARECAAYFAksNBV4ACgkQGgk1S8edB3JqWgCfb61pxGvh+KCXNfNdWgF2kb/P
&lt;br&gt;&amp;gt;&amp;gt; xCMAn2dSOgN9AiFYX35Ga00XyxZQwGnw
&lt;br&gt;&amp;gt;&amp;gt; =NL6k
&lt;br&gt;&amp;gt;&amp;gt; -----END PGP SIGNATURE-----
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; --
&lt;br&gt;&amp;gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;akan ada dimana mulut terkunci dan suara tak ada lagi..
&lt;br&gt;saat itu gunakanlah HP untuk melakukan SMS!!
&lt;br&gt;-&amp;gt; ini aliran bedul.. bukan aliran aneh.
&lt;br&gt;tertawa sebelum tertawa didepan RSJ..
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/unlink-problems-tp26510353p26523884.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26511543</id>
	<title>Re: unlink problems</title>
	<published>2009-11-25T04:02:07Z</published>
	<updated>2009-11-25T04:02:07Z</updated>
	<author>
		<name>Kesavan Rengarajan</name>
	</author>
	<content type="html">Looks like the PDF is not in the admin directory. Try to use the full &amp;nbsp;
&lt;br&gt;path to the PDF file and also check the permissions on the file.
&lt;br&gt;&lt;br&gt;Sent from my iPhone
&lt;br&gt;&lt;br&gt;On 25/11/2009, at 9:22 PM, Neil Jackson &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26511543&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;neil@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;&amp;gt; Hash: SHA1
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; I use the following to delete a file on a webserver
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;if( unlink( &amp;quot;./$filename&amp;quot; ) )
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo $filename.&amp;quot; deleted &amp;quot;;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$action='';
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo
&lt;br&gt;&amp;gt; &amp;quot;&amp;lt;script&amp;gt;document.location.href='$PHP_SELF?action=$action&amp;code= 
&lt;br&gt;&amp;gt; $code'&amp;lt;/script&amp;gt;&amp;quot;;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But I get the following error
&lt;br&gt;&amp;gt; Warning: unlink(./6 November 2009.pdf): No such file or directory in
&lt;br&gt;&amp;gt; /srv/www/htdocs/bee_partners/admin/tenders.php on line 82 6 November
&lt;br&gt;&amp;gt; 2009.pdf not deleted
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Any help?
&lt;br&gt;&amp;gt; -----BEGIN PGP SIGNATURE-----
&lt;br&gt;&amp;gt; Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;&amp;gt; Comment: Using GnuPG with SUSE - &lt;a href=&quot;http://enigmail.mozdev.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; iEYEARECAAYFAksNBV4ACgkQGgk1S8edB3JqWgCfb61pxGvh+KCXNfNdWgF2kb/P
&lt;br&gt;&amp;gt; xCMAn2dSOgN9AiFYX35Ga00XyxZQwGnw
&lt;br&gt;&amp;gt; =NL6k
&lt;br&gt;&amp;gt; -----END PGP SIGNATURE-----
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/unlink-problems-tp26510353p26511543.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26510353</id>
	<title>unlink problems</title>
	<published>2009-11-25T02:19:35Z</published>
	<updated>2009-11-25T02:19:35Z</updated>
	<author>
		<name>Neil Jackson</name>
	</author>
	<content type="html">-----BEGIN PGP SIGNED MESSAGE-----
&lt;br&gt;Hash: SHA1
&lt;br&gt;&lt;br&gt;Hi,
&lt;br&gt;I use the following to delete a file on a webserver
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if( unlink( &amp;quot;./$filename&amp;quot; ) )
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo $filename.&amp;quot; deleted &amp;quot;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $action='';
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo
&lt;br&gt;&amp;quot;&amp;lt;script&amp;gt;document.location.href='$PHP_SELF?action=$action&amp;code=$code'&amp;lt;/script&amp;gt;&amp;quot;;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;But I get the following error
&lt;br&gt;Warning: unlink(./6 November 2009.pdf): No such file or directory in
&lt;br&gt;/srv/www/htdocs/bee_partners/admin/tenders.php on line 82 6 November
&lt;br&gt;2009.pdf not deleted
&lt;br&gt;&lt;br&gt;Any help?
&lt;br&gt;-----BEGIN PGP SIGNATURE-----
&lt;br&gt;Version: GnuPG v2.0.9 (GNU/Linux)
&lt;br&gt;Comment: Using GnuPG with SUSE - &lt;a href=&quot;http://enigmail.mozdev.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://enigmail.mozdev.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;iEYEARECAAYFAksNBV4ACgkQGgk1S8edB3JqWgCfb61pxGvh+KCXNfNdWgF2kb/P
&lt;br&gt;xCMAn2dSOgN9AiFYX35Ga00XyxZQwGnw
&lt;br&gt;=NL6k
&lt;br&gt;-----END PGP SIGNATURE-----
&lt;br&gt;&lt;br&gt;&lt;br /&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/unlink-problems-tp26510353p26510353.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26349672</id>
	<title>Re: mySQL query syntax error</title>
	<published>2009-11-14T04:35:18Z</published>
	<updated>2009-11-14T04:35:18Z</updated>
	<author>
		<name>Ron Piggott-2</name>
	</author>
	<content type="html">&lt;br&gt;I found the problem. &amp;nbsp;The first subquery needed &amp;quot;AS&amp;quot; aliases. &amp;nbsp;I am
&lt;br&gt;learning more of what mySQL is capable of and appreciate the help. &amp;nbsp;Ron
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: TG &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26349672&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tg-php@...&lt;/a&gt;&amp;gt;
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26349672&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ron.piggott@...&lt;/a&gt;
&lt;br&gt;Subject: Re: [PHP-DB] mySQL query syntax error
&lt;br&gt;Date: Sat, 14 Nov 2009 07:17:53 -0500
&lt;br&gt;&lt;br&gt;&lt;br&gt;Only half awake and don't really see the problem with customers.email since 
&lt;br&gt;you alias the two selects and union as 'customers'. &amp;nbsp;But since you don't 
&lt;br&gt;have any other tables in your primary select, you can drop the 
&lt;br&gt;`customers` part and just say &amp;quot;ORDER BY email ASC&amp;quot;.
&lt;br&gt;&lt;br&gt;----- Original Message -----
&lt;br&gt;From: Ron Piggott &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26349672&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;ron.piggott@...&lt;/a&gt;&amp;gt;
&lt;br&gt;To: PHP DB &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26349672&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;php-db@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sat, 14 Nov 2009 03:23:47 -0500
&lt;br&gt;Subject: [PHP-DB] mySQL query syntax error
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I am getting the following error message:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; #1054 - Unknown column 'customers.email' in 'order clause'
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; from the query below --- I don't understand why. &amp;nbsp;Would someone help me
&lt;br&gt;&amp;gt; please? &amp;nbsp;Ron
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SELECT 'first_name', 'last_name', 'email'
&lt;br&gt;&amp;gt; FROM (
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SELECT `firstname` , `lastname` , `buyer_email` 
&lt;br&gt;&amp;gt; FROM `paypal_payment_info` 
&lt;br&gt;&amp;gt; WHERE `datecreation` = '$two_weeks_ago'
&lt;br&gt;&amp;gt; GROUP BY `buyer_email` 
&lt;br&gt;&amp;gt; )
&lt;br&gt;&amp;gt; UNION ALL (
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; SELECT `mail_order_address`.`first_name` ,
&lt;br&gt;&amp;gt; `mail_order_address`.`last_name` , `mail_order_address`.`email` 
&lt;br&gt;&amp;gt; FROM `mail_order_address` 
&lt;br&gt;&amp;gt; INNER JOIN `mail_order_payment` ON `mail_order_address`.`reference` =
&lt;br&gt;&amp;gt; `mail_order_payment`.`mail_order_address_reference` 
&lt;br&gt;&amp;gt; WHERE `mail_order_payment`.`payment_received` = '$two_weeks_ago'
&lt;br&gt;&amp;gt; GROUP BY `mail_order_address`.`email` 
&lt;br&gt;&amp;gt; )
&lt;br&gt;&amp;gt; ) AS customers
&lt;br&gt;&amp;gt; ORDER BY `customers`.`email` ASC 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mySQL-query-syntax-error-tp26348098p26349672.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26348098</id>
	<title>mySQL query syntax error</title>
	<published>2009-11-14T00:23:46Z</published>
	<updated>2009-11-14T00:23:46Z</updated>
	<author>
		<name>Ron Piggott-2</name>
	</author>
	<content type="html">&lt;br&gt;I am getting the following error message:
&lt;br&gt;&lt;br&gt;#1054 - Unknown column 'customers.email' in 'order clause'
&lt;br&gt;&lt;br&gt;from the query below --- I don't understand why. &amp;nbsp;Would someone help me
&lt;br&gt;please? &amp;nbsp;Ron
&lt;br&gt;&lt;br&gt;&lt;br&gt;SELECT 'first_name', 'last_name', 'email'
&lt;br&gt;FROM (
&lt;br&gt;&lt;br&gt;(
&lt;br&gt;&lt;br&gt;SELECT `firstname` , `lastname` , `buyer_email` 
&lt;br&gt;FROM `paypal_payment_info` 
&lt;br&gt;WHERE `datecreation` = '$two_weeks_ago'
&lt;br&gt;GROUP BY `buyer_email` 
&lt;br&gt;)
&lt;br&gt;UNION ALL (
&lt;br&gt;&lt;br&gt;SELECT `mail_order_address`.`first_name` ,
&lt;br&gt;`mail_order_address`.`last_name` , `mail_order_address`.`email` 
&lt;br&gt;FROM `mail_order_address` 
&lt;br&gt;INNER JOIN `mail_order_payment` ON `mail_order_address`.`reference` =
&lt;br&gt;`mail_order_payment`.`mail_order_address_reference` 
&lt;br&gt;WHERE `mail_order_payment`.`payment_received` = '$two_weeks_ago'
&lt;br&gt;GROUP BY `mail_order_address`.`email` 
&lt;br&gt;)
&lt;br&gt;) AS customers
&lt;br&gt;ORDER BY `customers`.`email` ASC 
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mySQL-query-syntax-error-tp26348098p26348098.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26335263</id>
	<title>Join Multiply</title>
	<published>2009-11-13T03:34:06Z</published>
	<updated>2009-11-13T03:34:06Z</updated>
	<author>
		<name>grafica pirituba (via Multiply)</name>
	</author>
	<content type="html">&lt;br&gt;Check out my Multiply site
&lt;br&gt;&lt;br&gt;I set up a Multiply site with my pictures, videos and blog and I want 
&lt;br&gt;to add you as my friend so you can see it. First, you need to join 
&lt;br&gt;Multiply! Once you join, you can also create your own site and share 
&lt;br&gt;anything you want, with anyone you want.
&lt;br&gt;&lt;br&gt;Here's the link:
&lt;br&gt;&lt;a href=&quot;http://multiply.com/si/Q+8gUs9BkFj71dvZx2+5vA&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://multiply.com/si/Q+8gUs9BkFj71dvZx2+5vA&lt;/a&gt;&lt;br&gt;&lt;br&gt;Gampang Kerja Cepat Dapet Duit, Flexter Bisnis Online Dahsyat!!!Cepat 
&lt;br&gt;Dapat Jutaan
&lt;br&gt;Pengen cepet dapet duit?? ayo gabung FLEXTER! Dapet PULSA MURAH, Dapet
&lt;br&gt;DUIT CEPET!
&lt;br&gt;Setiap member FLEXTER akan mendapat pulsa harga murah, bisa isi ulang 
&lt;br&gt;ke No HP sendiri dan ke No HP orang lain semua operator, setiap member
&lt;br&gt;FLEXTER akan mendapatkan PELUANG BISNIS YANG LUAR BIASA dengan potensi
&lt;br&gt;PENGHASILAN PASIF YANG TANPA BATAS!!
&lt;br&gt;Bingung cara promosi? ga usah bingung anda tinggal gabung lewat 
&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=mulyani&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=mulyani&lt;/a&gt;&amp;nbsp;member datang sendiri pada anda, 
&lt;br&gt;karena kami memberi anda web pribadi untuk berpromosi secara online, 
&lt;br&gt;yang pastinya sangat membantu anda.
&lt;br&gt;Pengen cepet dapet duit?? ayo gabung FLEXTER! Dapet PULSA MURAH, Dapet
&lt;br&gt;DUIT CEPET!
&lt;br&gt;Setiap member FLEXTER akan mendapat pulsa harga murah, bisa isi ulang 
&lt;br&gt;ke No HP sendiri dan ke No HP orang lain semua operator, setiap member
&lt;br&gt;FLEXTER akan mendapatkan PELUANG BISNIS YANG LUAR BIASA dengan potensi
&lt;br&gt;PENGHASILAN PASIF YANG TANPA BATAS!!
&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=iwan&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=iwan&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=iwan&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=iwan&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=iwan&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=iwan&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=iwan&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=iwan&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.famsflex.com/?id=iwan&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.famsflex.com/?id=iwan&lt;/a&gt;&lt;br&gt;&lt;br&gt;thx
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;iwan
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Stop e-mails, view our privacy policy, or report abuse: 
&lt;br&gt;&lt;a href=&quot;http://multiply.com/bl/Q+8gUs9BkFj71dvZx2+5vA&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://multiply.com/bl/Q+8gUs9BkFj71dvZx2+5vA&lt;/a&gt;&lt;br&gt;We haven't added your email address to any lists, nor will we share it
&lt;br&gt;with anyone at any time.
&lt;br&gt;Copyright 2009 Multiply Inc.
&lt;br&gt;6001 Park of Commerce, Boca Raton, FL 33487, USA
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Join-Multiply-tp26335263p26335263.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26327174</id>
	<title>Re: Multiple instances of mysql_connect() in single PHP document.</title>
	<published>2009-11-12T13:52:56Z</published>
	<updated>2009-11-12T13:52:56Z</updated>
	<author>
		<name>chris smith-9</name>
	</author>
	<content type="html">Richard Quadling wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 2009/11/11 Chris &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26327174&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dmagick@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt;&amp;gt; Plus the assumption that they are on the same server and that the user
&lt;br&gt;&amp;gt;&amp;gt; you're connecting with has access to both databases..
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; See the initial post.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $db_material = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;);
&lt;br&gt;&amp;gt; $db_labor = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2 connections using the same server and credentials - results in 1
&lt;br&gt;&amp;gt; real connection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $db_material = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;, true);
&lt;br&gt;&amp;gt; $db_labor = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;, true);
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; should fix it.
&lt;/div&gt;&lt;br&gt;Good pickup - the rest of us missed it :)
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Postgresql &amp; php tutorials
&lt;br&gt;&lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Multiple-instances-of-mysql_connect%28%29-in-single-PHP-document.-tp26291295p26327174.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26327164</id>
	<title>Re: losing MySQL resource</title>
	<published>2009-11-12T13:51:22Z</published>
	<updated>2009-11-12T13:51:22Z</updated>
	<author>
		<name>chris smith-9</name>
	</author>
	<content type="html">Stan wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I don't understand the process. &amp;nbsp;When session_start() reconnects to a (the)
&lt;br&gt;&amp;gt; session, objects saved as $_SESSION variables must be &amp;quot;recreated&amp;quot;. &amp;nbsp;To do
&lt;br&gt;&amp;gt; this requires the class definition. &amp;nbsp;So the class definition must be loaded
&lt;br&gt;&amp;gt; prior to calling session_start().
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Some other languages I've written in had a process called serialization
&lt;br&gt;&amp;gt; through which objects were saved. &amp;nbsp;And an opposite (deserialization?)
&lt;br&gt;&amp;gt; process through which objects were restored. &amp;nbsp;To have &amp;quot;persistent&amp;quot; objects
&lt;br&gt;&amp;gt; requires some way to &amp;quot;save&amp;quot; the objects for the next invocation of the
&lt;br&gt;&amp;gt; application (PHP in this case). &amp;nbsp;Deserialization necessarily requires the
&lt;br&gt;&amp;gt; template upon which the original object was built (the class definition).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I found &lt;a href=&quot;http://us.php.net/serialize&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://us.php.net/serialize&lt;/a&gt;&amp;nbsp;in the online PHP manual. &amp;nbsp;I also found
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://us.php.net/manual/en/language.oop5.autoload.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://us.php.net/manual/en/language.oop5.autoload.php&lt;/a&gt;&amp;nbsp;in the online PHP
&lt;br&gt;&amp;gt; manual (I have not tried autoload).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I simply moved the require_once(&amp;quot;class_definitions.inc&amp;quot;); to appear
&lt;br&gt;&amp;gt; immediately before my session_start(); and everything worked thereafter.
&lt;/div&gt;&lt;br&gt;When data gets serialized in the session, it only stores the data itself 
&lt;br&gt;(public/private variables). It does not store the actual class (your 
&lt;br&gt;methods) and the code that makes it all work. That would just bloat the 
&lt;br&gt;session and cause other extra headaches.
&lt;br&gt;&lt;br&gt;So before the data can be properly loaded, you need the class.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://us.php.net/manual/en/language.oop5.serialization.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://us.php.net/manual/en/language.oop5.serialization.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;explains things a little better I hope.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Postgresql &amp; php tutorials
&lt;br&gt;&lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/losing-MySQL-resource-tp25520290p26327164.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26318437</id>
	<title>Re: Multiple instances of mysql_connect() in single PHP  document.</title>
	<published>2009-11-12T05:13:22Z</published>
	<updated>2009-11-12T05:13:22Z</updated>
	<author>
		<name>Richard Quadling</name>
	</author>
	<content type="html">2009/11/11 Chris &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26318437&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dmagick@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; Plus the assumption that they are on the same server and that the user
&lt;br&gt;&amp;gt; you're connecting with has access to both databases..
&lt;br&gt;&lt;br&gt;See the initial post.
&lt;br&gt;&lt;br&gt;$db_material = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;);
&lt;br&gt;$db_labor = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;);
&lt;br&gt;&lt;br&gt;2 connections using the same server and credentials - results in 1
&lt;br&gt;real connection.
&lt;br&gt;&lt;br&gt;$db_material = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;, true);
&lt;br&gt;$db_labor = mysql_connect(&amp;quot;localhost&amp;quot;, &amp;quot;root&amp;quot;, &amp;quot;secret&amp;quot;, true);
&lt;br&gt;&lt;br&gt;should fix it.
&lt;br&gt;-- 
&lt;br&gt;-----
&lt;br&gt;Richard Quadling
&lt;br&gt;&amp;quot;Standing on the shoulders of some very clever giants!&amp;quot;
&lt;br&gt;EE : &lt;a href=&quot;http://www.experts-exchange.com/M_248814.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.experts-exchange.com/M_248814.html&lt;/a&gt;&lt;br&gt;Zend Certified Engineer : &lt;a href=&quot;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&lt;/a&gt;&lt;br&gt;ZOPA : &lt;a href=&quot;http://uk.zopa.com/member/RQuadling&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://uk.zopa.com/member/RQuadling&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Multiple-instances-of-mysql_connect%28%29-in-single-PHP-document.-tp26291295p26318437.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26318407</id>
	<title>Re: Multiple instances of mysql_connect() in single PHP  document.</title>
	<published>2009-11-12T05:11:25Z</published>
	<updated>2009-11-12T05:11:25Z</updated>
	<author>
		<name>Richard Quadling</name>
	</author>
	<content type="html">2009/11/11 Chris &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26318407&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dmagick@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Andy Shellam (Mailing Lists) wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; If the databases are in the same mysql server, then you could qualify
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the table select with the database name and simply re-use the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; connection
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; select db_name.table_name.field from db_name.table_name [where]
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; No offence, but if I saw this in an application's source code, I'd run a
&lt;br&gt;&amp;gt;&amp;gt; mile.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Plus the assumption that they are on the same server and that the user
&lt;br&gt;&amp;gt; you're connecting with has access to both databases..
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Postgresql &amp; php tutorials
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;If it comes to that, if you are writing SQL code in PHP rather than
&lt;br&gt;abstracting it or using stored procedures/views/etc. ...
&lt;br&gt;&lt;br&gt;Essentially the issue is 2 identical connections are not actually 2
&lt;br&gt;identical connections.
&lt;br&gt;&lt;br&gt;They are 2 references to a single connection.
&lt;br&gt;&lt;br&gt;So, changing the DB via 1 resource changes the db for both resources.
&lt;br&gt;&lt;br&gt;NOTE: IDENTICAL. If the server or username is different, then that
&lt;br&gt;results in a separate connection.
&lt;br&gt;&lt;br&gt;&amp;lt;?php
&lt;br&gt;$conn1 = mysql_connect($server, $username, $password);
&lt;br&gt;$conn2 = mysql_connect($server, $username, $password); // Is the same
&lt;br&gt;connection as $conn1
&lt;br&gt;mysql_select_db($db1, $conn1); // Both connection resources are now
&lt;br&gt;looking at db1.
&lt;br&gt;mysql_select_db($db2, $conn2); // Both connection resources are now
&lt;br&gt;looing at db2.
&lt;br&gt;&lt;br&gt;_ONE_ solution is to use fully qualified names (you can use constants
&lt;br&gt;if you don't like hard-coding the db name in the query).
&lt;br&gt;&lt;br&gt;Another option is to set the new_link flag on the mysql_connect() call.
&lt;br&gt;&lt;br&gt;That way you will have 2 separate connections.
&lt;br&gt;&lt;br&gt;&amp;lt;?php
&lt;br&gt;$conn1 = mysql_connect($server, $username, $password, true);
&lt;br&gt;$conn2 = mysql_connect($server, $username, $password, true); // Is NOT
&lt;br&gt;the same connection as $conn1
&lt;br&gt;mysql_select_db($db1, $conn1); // Points to db1 for connection1
&lt;br&gt;mysql_select_db($db2, $conn2); // Points to db2 for connection2
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;-----
&lt;br&gt;Richard Quadling
&lt;br&gt;&amp;quot;Standing on the shoulders of some very clever giants!&amp;quot;
&lt;br&gt;EE : &lt;a href=&quot;http://www.experts-exchange.com/M_248814.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.experts-exchange.com/M_248814.html&lt;/a&gt;&lt;br&gt;Zend Certified Engineer : &lt;a href=&quot;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://zend.com/zce.php?c=ZEND002498&amp;r=213474731&lt;/a&gt;&lt;br&gt;ZOPA : &lt;a href=&quot;http://uk.zopa.com/member/RQuadling&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://uk.zopa.com/member/RQuadling&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Multiple-instances-of-mysql_connect%28%29-in-single-PHP-document.-tp26291295p26318407.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26316887</id>
	<title>Re: losing MySQL resource</title>
	<published>2009-11-12T03:12:00Z</published>
	<updated>2009-11-12T03:12:00Z</updated>
	<author>
		<name>Stan-51</name>
	</author>
	<content type="html">I don't understand the process. &amp;nbsp;When session_start() reconnects to a (the)
&lt;br&gt;session, objects saved as $_SESSION variables must be &amp;quot;recreated&amp;quot;. &amp;nbsp;To do
&lt;br&gt;this requires the class definition. &amp;nbsp;So the class definition must be loaded
&lt;br&gt;prior to calling session_start().
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Some other languages I've written in had a process called serialization
&lt;br&gt;through which objects were saved. &amp;nbsp;And an opposite (deserialization?)
&lt;br&gt;process through which objects were restored. &amp;nbsp;To have &amp;quot;persistent&amp;quot; objects
&lt;br&gt;requires some way to &amp;quot;save&amp;quot; the objects for the next invocation of the
&lt;br&gt;application (PHP in this case). &amp;nbsp;Deserialization necessarily requires the
&lt;br&gt;template upon which the original object was built (the class definition).
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;I found &lt;a href=&quot;http://us.php.net/serialize&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://us.php.net/serialize&lt;/a&gt;&amp;nbsp;in the online PHP manual. &amp;nbsp;I also found
&lt;br&gt;&lt;a href=&quot;http://us.php.net/manual/en/language.oop5.autoload.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://us.php.net/manual/en/language.oop5.autoload.php&lt;/a&gt;&amp;nbsp;in the online PHP
&lt;br&gt;manual (I have not tried autoload).
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;I simply moved the require_once(&amp;quot;class_definitions.inc&amp;quot;); to appear
&lt;br&gt;immediately before my session_start(); and everything worked thereafter.
&lt;br&gt;&lt;br&gt;&amp;quot;Nehemias Duarte&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;NDuarte@...&lt;/a&gt;&amp;gt; wrote in message
&lt;br&gt;news:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;2A10E35796E8A84FB782111FE5D3B30A03604B@...&lt;/a&gt;...
&lt;br&gt;I was under the impression that session_start() had to be the FIRST
&lt;br&gt;thing ran in the script. Is this incorrect?
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt;OK. &amp;nbsp;The secret, as has been stated here before, is to load the class
&lt;br&gt;definitions BEFORE calling session_start(). &amp;nbsp;Thanks to everyone.
&lt;br&gt;&lt;br&gt;&amp;quot;&amp;quot;Andy Shellam (Mailing Lists)&amp;quot;&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andy-lists@...&lt;/a&gt;&amp;gt; wrote in
&lt;br&gt;message news:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;3339C510-BE08-4426-9265-BA1965A9ADDF@...&lt;/a&gt;...
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Stan,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Are you saving the instance of your class in $_SESSION?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Class instances can be persisted across sessions, however resources
&lt;br&gt;&amp;gt; (i.e. MySQL and other DB connections) cannot. &amp;nbsp;What you need to do, is
&lt;br&gt;&amp;gt; every method in your wrapper class that uses the MySQL resource needs
&lt;br&gt;&amp;gt; to check if it's a valid resource (is_resource() springs to mind.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If it isn't valid, you need to re-create it (using mysql_connect).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The reason for this is that PHP isn't running between session
&lt;br&gt;&amp;gt; requests, so it cannot maintain and monitor the database connection
&lt;br&gt;&amp;gt; across requests.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Andy
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On 9 November2009, at 21:11, Stan wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I got as far as creating a class to be the wrapper ... instantiating
&lt;br&gt;&amp;gt; &amp;gt; an
&lt;br&gt;&amp;gt; &amp;gt; object of that class ... saving the reference in a $_SESSION
&lt;br&gt;&amp;gt; &amp;gt; variable ...
&lt;br&gt;&amp;gt; &amp;gt; but my object reference seems to be invalid upon the next request
&lt;br&gt;&amp;gt; &amp;gt; (in the
&lt;br&gt;&amp;gt; &amp;gt; same session) from the client browser. &amp;nbsp;What have I missed?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Thanks,
&lt;br&gt;&amp;gt; &amp;gt; Stan
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;&amp;quot;Andy Shellam (Mailing Lists)&amp;quot;&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;andy-lists@...&lt;/a&gt;&amp;gt; wrote
&lt;/div&gt;in
&lt;br&gt;&amp;gt; &amp;gt; message news:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;FD8200B0-E18A-4AFD-8FFC-F51080621BB4@...&lt;/a&gt;...
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; I got around this by creating a database wrapper class which gets
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; passed the credentials from the app's config file. &amp;nbsp;An instance of
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; class is created and saved in the session, and every query to the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; database runs through the class's Query() wrapper method which
&lt;br&gt;checks
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; if the connection is alive and valid - if it isn't, it reconnects
&lt;br&gt;it
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; before running the query.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Andy
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; On 9 November2009, at 16:46, Stan wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; How do I make an Object persistant for the duration of a Session?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;quot;Chris&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dmagick@...&lt;/a&gt;&amp;gt; wrote in message news:4AB6B16C.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26316887&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;8@...&lt;/a&gt;...
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Niel Archer wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I'm maintaining a session. &amp;nbsp;I successfully connect to a
&lt;/div&gt;database
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; ($DBConnect
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; = mysql_connect()). &amp;nbsp;I save the connection resource in a
&lt;br&gt;session
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; variable
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ($_SESSION['connection'] = $DBConnect) ... to use in subsequent
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; queries. &amp;nbsp;It
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; remains valid while the user is on the current page.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; print_r($_SESSION['connection']) yields 'Resource id #3', for
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; instance.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; User browses to a new page ... in the same session.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; $_SESSION['$DBConnect']
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; no longer references a valid mysql resource.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; print_r($_SESSION['connection']) yields '0'.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Other &amp;quot;ordinary&amp;quot; values saved in $_SESSION variables remain
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; valid.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Is there something special about a mysql resource?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Not about the resource itself, no. PHP closes connections to a
&lt;/div&gt;Db
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; script ends, unless the connection is persistent, so while the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; resource
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; IS saved, the connection to which it refers no longer exists.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; No resources (whether they are persistent or not) can be stored
&lt;br&gt;in
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; session.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.php.net/manual/en/intro.session.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/manual/en/intro.session.php&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; The big pink box has more info.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; Postgresql &amp; php tutorials
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://www.designmagick.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.designmagick.com/&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; -- 
&lt;br&gt;&amp;gt; &amp;gt; PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;&amp;gt; &amp;gt; To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;Confidentiality Notice:
&lt;br&gt;This e-mail and any attachments may contain confidential information
&lt;br&gt;intended solely for the use of the addressee. &amp;nbsp;If the reader of this message
&lt;br&gt;is not the intended recipient, any distribution, copying, or use of this
&lt;br&gt;e-mail or its attachments is prohibited. &amp;nbsp;If you received this message in
&lt;br&gt;error, please notify the sender immediately by e-mail and delete this
&lt;br&gt;message and any copies. Thank you.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;PHP Database Mailing List (&lt;a href=&quot;http://www.php.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/&lt;/a&gt;)
&lt;br&gt;To unsubscribe, visit: &lt;a href=&quot;http://www.php.net/unsub.php&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.php.net/unsub.php&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/losing-MySQL-resource-tp25520290p26316887.html" />
</entry>

</feed>
