Re: [PHP-DB] Creating an INDEX on multiple tables?

2010-10-22 Thread Ron Piggott

I have moved the GROUP BY outside now Chris.

In the queries that make up the UNION ALL (such as below) is there a way to 
only SELECT matches that are 70% or greater based on the users input?  Right 
now each and every listing is a search result.


Ron

===

SELECT `ministry_profiles`.`reference`, `ministry_profiles`.`organization` 
FROM

(
(
( `ministry_profiles` LEFT OUTER JOIN `ministry_profiles_listing_details` ON 
`ministry_profiles`.`reference` = 
`ministry_profiles_listing_details`.`ministry_profile_reference` )
LEFT OUTER JOIN `ministry_profiles_activity` ON 
`ministry_profiles`.`reference` = 
`ministry_profiles_activity`.`ministry_profiles_reference` )
LEFT OUTER JOIN `ministry_profile_categories` ON 
`ministry_profiles`.`reference` = 
`ministry_profile_categories`.`ministry_profiles_reference` )
LEFT OUTER JOIN `ministry_categories` ON 
`ministry_profile_categories`.`ministry_categories_reference` = 
`ministry_categories`.`reference`

WHERE
MATCH( `ministry_profiles_activity`.`activity` )
AGAINST
('$search')

AND `ministry_profiles_activity`.`live` =1




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] [PHP5 AdoDB] Correct return value after oracle package function call should be a string and I get a number instead.

2010-10-22 Thread Andrew Raimondi

Hello.

I'm using PHP5 and ADODb(could not find a version number for the life of me, 
the closest thing I could
find is an old-changelog.htm file topping version 3.92.22 well buried in a 
docs folder).

I have this php code:

/*getTitoloFromID si riferisce alla tabella CONF_RELAZIONI!!!*/
function getTitoloFromID( $anno, $trimestre,$id )
{
 $r_titolo = str_pad('', 50,'@');

 $params = array(
  'p_anno'= $anno,
  'p_trimestre' = $trimestre,
  'p_id'= $id,
  'r_titolo'= $r_titolo
 );

 trace( 'Parametri: ');
 trace( $params );

 $sql = BEGIN :r_titolo := 
PKG_RELAZIONI.getTitoloFromID(:p_anno,:p_trimestre,:p_id); END;;

 $this-Execute($sql, $params);
 trace( 'Titolo nella chiamata: '.$r_titolo);
 return $r_titolo;
}

Backend is Oracle(don't know the version, again don't have a clue where to 
look for it, but I'm
pretty sure it's above 9 because we use constructs that... d'oh! are present 
from ver 9 on :D).


When I check the LOGS table in my db, I see the *correct* result being 
added.
When this value gets to PHP, however, something happens and I receive the 
value 1(without quotes)
without any apparent reason. The correct value is a string and, again, it 
gets displayed in the logs

table correctly, hence I assume the SQL is correct.
I am also sure it does not depend on the params(trimestre means quarter, the 
first thing I thought was
that I could be misplacing parameters or something like that) but that's not 
the case either.
Return value is properly sized because I had already received the invalid 
buffer size error.

Other calls use the same pattern and they all work beautifully.
I am pretty much at loss and would love some help nailing this because I 
can't seem to

wrap my head around it :-)

Many thanks for reading this :-)

Andrew


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] big table / hadoop / map reduce

2010-10-22 Thread Artur Ejsmont
Hi there guys and girls

Have anyone came across any reasonable explanation / articles on how
hadoop and map reduce work in practice?

i have read a few articles now and then and i must say i am puzzled
 am i stupid or they just cant find an easy way to explain it? :P

What i would hope for is explanation on simple example of application
with some code samples preferably.

anyone good at it here?

cheers

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] big table / hadoop / map reduce

2010-10-22 Thread Andrés G . Montañez
Hi Artur,

Here is an article on wikipedia: http://en.wikipedia.org/wiki/MapReduce

And here are the native implementations in php:
http://www.php.net/manual/en/function.array-map.php
http://www.php.net/manual/en/function.array-reduce.php

The basic idea is to gather a lot of data, from several nodes, and
map them togheter;
then, assuming a lot of this data is repeated across the dataset, we
reduce them.


Cheers.

On 22 October 2010 12:14, Artur Ejsmont ejsmont.ar...@gmail.com wrote:
 Hi there guys and girls

 Have anyone came across any reasonable explanation / articles on how
 hadoop and map reduce work in practice?

 i have read a few articles now and then and i must say i am puzzled
  am i stupid or they just cant find an easy way to explain it? :P

 What i would hope for is explanation on simple example of application
 with some code samples preferably.

 anyone good at it here?

 cheers

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] big table / hadoop / map reduce

2010-10-22 Thread Artur Ejsmont
hehe  sorry but this does not help :-) i can google for wikipedia
definitions.

I was hoping for some really good articles/examples that would put it
into enough context. I would like to have good idea when it could be
useful.

So far had no luck with that. Its like with design patterns ... people
who dont understand them should not write articles trying to explain
them to others :P

Art

On 22 October 2010 15:29, Andrés G. Montañez andresmonta...@gmail.com wrote:
 Hi Artur,

 Here is an article on wikipedia: http://en.wikipedia.org/wiki/MapReduce

 And here are the native implementations in php:
 http://www.php.net/manual/en/function.array-map.php
 http://www.php.net/manual/en/function.array-reduce.php

 The basic idea is to gather a lot of data, from several nodes, and
 map them togheter;
 then, assuming a lot of this data is repeated across the dataset, we
 reduce them.


 Cheers.

 On 22 October 2010 12:14, Artur Ejsmont ejsmont.ar...@gmail.com wrote:
 Hi there guys and girls

 Have anyone came across any reasonable explanation / articles on how
 hadoop and map reduce work in practice?

 i have read a few articles now and then and i must say i am puzzled
  am i stupid or they just cant find an easy way to explain it? :P

 What i would hope for is explanation on simple example of application
 with some code samples preferably.

 anyone good at it here?

 cheers

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 --
 Andrés G. Montañez
 Zend Certified Engineer
 Montevideo - Uruguay




-- 
Visit me at:
http://artur.ejsmont.org/blog/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] big table / hadoop / map reduce

2010-10-22 Thread Andrés G . Montañez
Imagine you have to get track of some kind of traffic, for example,
ad impressions;
lets supose that you have millions of those hits; you will have to
have a few servers to
receive the notifications of the impression of an ad.

After the end of the day, you will have that info across a bunch of
servers; mostly you will have
a record of each impression indicating the Identifier (id) of the Ad.

To this info to become useful, you will have to agregate it; for
example to know which is the Ad with most impressions.
You will have to iterate over all servers and MAP the info into one
place; now that you have all the info,
you will have to REDUCE it; so you will have one record per Ad
identifier indicating the TOTAL impressions of that day.

That's the basic idea. It's like aftermath of Divide and Conquer.

Hope this will be useful.

Cheers.

On 22 October 2010 13:27, Artur Ejsmont ejsmont.ar...@gmail.com wrote:
 hehe  sorry but this does not help :-) i can google for wikipedia
 definitions.

 I was hoping for some really good articles/examples that would put it
 into enough context. I would like to have good idea when it could be
 useful.

 So far had no luck with that. Its like with design patterns ... people
 who dont understand them should not write articles trying to explain
 them to others :P

 Art

 On 22 October 2010 15:29, Andrés G. Montañez andresmonta...@gmail.com wrote:
 Hi Artur,

 Here is an article on wikipedia: http://en.wikipedia.org/wiki/MapReduce

 And here are the native implementations in php:
 http://www.php.net/manual/en/function.array-map.php
 http://www.php.net/manual/en/function.array-reduce.php

 The basic idea is to gather a lot of data, from several nodes, and
 map them togheter;
 then, assuming a lot of this data is repeated across the dataset, we
 reduce them.


 Cheers.

 On 22 October 2010 12:14, Artur Ejsmont ejsmont.ar...@gmail.com wrote:
 Hi there guys and girls

 Have anyone came across any reasonable explanation / articles on how
 hadoop and map reduce work in practice?

 i have read a few articles now and then and i must say i am puzzled
  am i stupid or they just cant find an easy way to explain it? :P

 What i would hope for is explanation on simple example of application
 with some code samples preferably.

 anyone good at it here?

 cheers

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 --
 Andrés G. Montañez
 Zend Certified Engineer
 Montevideo - Uruguay




 --
 Visit me at:
 http://artur.ejsmont.org/blog/




-- 
Andrés G. Montañez
Zend Certified Engineer
Montevideo - Uruguay

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-22 Thread listread

Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone over 
the internet?


An alternative would be syncing with Google Contacts, which then could 
sync with the iPhone.  I think Google Contacts uses Exchange Server to 
sync with devices.


Thanks!

- Ron



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] How to Sync MySQL with iPhone or Google Contacts

2010-10-22 Thread Karl DeSaulniers

I believe there is a MySQL for the iphone
iMy?

http://forums.mysql.com/read.php?58,249718,249718

You'd probably want o use JASON or an equiv. to talk back and forth  
with your database and app.

At least thats the consensus I'm finding on posts about it.

HTH
Karl

On Oct 22, 2010, at 11:21 PM, listread wrote:


Hey all!

Does anyone know how to go about syncing a MySQL db with an iPhone  
over the internet?


An alternative would be syncing with Google Contacts, which then  
could sync with the iPhone.  I think Google Contacts uses Exchange  
Server to sync with devices.


Thanks!

- Ron



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php