Re: [PHP-DB] Code optimization

2009-08-07 Thread Phpster
On Aug 6, 2009, at 7:52 PM, "Ron Piggott" wrote: Is there a way to optimize this with better mySQL query? # Select today's Bible verse mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM verse_of_the_da

Re: [PHP-DB] Re: "COUNT() returns 0 if there were no matching rows." .... really?!

2009-08-07 Thread John Butler
Here's an example (snip) from a var_dump of that $BuildPerUniqueDateArray: (note that the 'aweber_7solar_aw' table does NOT have a record for the date '2009-07-28', so I would expect to see that "1" to be a "0" there.) I fixed this. The problem was the way I was building the array inside

Re: [PHP-DB] Code optimization

2009-08-07 Thread chris smith
On Fri, Aug 7, 2009 at 5:10 PM, kranthi wrote: >>> You're assuming that. It could be the queries being run are the costliest. > > It has got nothing to do with the cost of query. bare mysql_connect() > is very costly. I'm not arguing with that, I'm saying that the cost of the mysql_connect could b

Re: [PHP-DB] Code optimization

2009-08-07 Thread kranthi
>> You're assuming that. It could be the queries being run are the costliest. It has got nothing to do with the cost of query. bare mysql_connect() is very costly. compare \n"; $time = microtime(true); mysql_connect('localhost', 'user', 'pass'); mysql_close(); echo (microtime(true) - $time); wit