![]() Topic awaiting preservation: Need help with SQL Pronto!!!!!! Please... (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: you tell me |
![]() Hi guys need help Pronto right here... I have ok two tables. One is basically an email repository and contains email messages - teh other table is an address book and well just contains email addresses. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() yeah. Don't do this in pure sql. |
Paranoid (IV) Inmate From: Switzerland |
![]() Have to disagree, having worked on large-large scale databases very recently : pre-fetch as much as possible inside the database engine itself. |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() I' assumed it to still be parity's roundcube project. code: $arrMails = query_db_fetch_array( "select header_to, header_from... from mails where Whatever"); $arrAddresses = []; foreach ( $arrMails as $arrMail) { $arrTo = split($arrMail['to'],','); //and pray for merce there never is a , in an e-mail address... the rfc is to large for me to exclude it. foreach ( $arrTo as $strAddress) $arraddresses[$strAddress] = true; } $arrAddresses = array_keys($arrAddresses); $arrAddresses = array_map('mysql_escape_string',$arrAddresses); $strAddresses = add quoting to each field..., and implode on (',') $strQuery = "select address, count(address) from addressbook where address in ({$strAddresses})"; ... do something for those with count == 0
|
Paranoid (IV) Inmate From: Switzerland |
![]() What were Tao's words already? "Mellowest prowess mister Prime". [off topic]I'd certainly like to collaborate |
Bipolar (III) Inmate From: you tell me |
![]() Hmmm.... |
Paranoid (IV) Inmate From: Switzerland |
![]() I understood the original request incorrectly, but : |
Maniac (V) Mad Scientist with Finglongers From: Germany |
![]() huh - why to arrays parity? |
Paranoid (IV) Inmate From: Switzerland |
![]() I am not interested in any form of rivalry in my life - I am interested in trying to give options quote:
|
Bipolar (III) Inmate From: you tell me |
![]() Well.. the thing is that since it is the same roundcubemail project... and thats why I'm actually trying to minimise if not avoid tampering with the roundcube db for fear of messing it somewhere else... apart from that I might give it a go on another version nwo that I've got tortoiseSVN up and running |
Paranoid (IV) Inmate From: Switzerland |
![]()
|