php-general Digest 28 Jul 2008 08:08:18 -0000 Issue 5593
Topics (messages 277373 through 277375):
Problem with using array_diff and array_combine
277373 by: Richard Kurth
Re: get current php locale
277374 by: Jay Blanchard
Re: Code beautifier
277375 by: Peter Ford
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
I hope I can explain what I am trying to do.
I have two tables the first one has the custom form elements
formelements_id formelements_field_type formelements_field_caption
members_id
35 text test 8
36 text test2 8
The second one has the customer id and the field value withe the field
name
dbelements_field_name dbelements_field_value members_id customer_id
35 Test This Field 8 346
36 8 346
36 Test2 8 347
If you look at the second table you will see that one field name is
related to two different customers
and one field name on relates to one customer.
I am trying to look at these two tables and find customer that do not
have a row for each field name.
I have been trying with
array_combine($dbelements_field_array,$dbelements_id_array)
and also
array_diff($customf_array,$dbelements_field_array)
This are the tables I /am using to create the arrays
/$contactsql = "SELECT * FROM contacts WHERE members_id = '8'";
$contact_result = |mysql_query|($contactsql);
while($contact_row=mysql_fetch_array($contact_result)){
$contactid_array[] = $contact_row['id'];
}
$sql1 = "SELECT * FROM dbelements WHERE members_id = '8'";
$sql_result1 = |mysql_query|($sql1);
while($row1=mysql_fetch_array($sql_result1)){
$dbelements_field_array[]=$row1["customer_id"];
$dbelements_field_array[].=$row1["dbelements_field_name"];
}
$sql2 = "SELECT * FROM customformelements WHERE members_id = '8'";
$sql_result2 = |mysql_query|($sql2);
while($row2=mysql_fetch_array($sql_result2)){
$customf_array[]=$row2["formelements_id"];
}
Could somebody get me going in the right directions
--- End Message ---
--- Begin Message ---
[snip]
is there a way to get the current locale being used by php and the
encoding
it uses?
[/snip]
Do you mean the locale where the computer connecting to the service is
using PHP? Remember, PHP is server side and has no way of gathering data
from a 'local' machine unless coupled with something like JavaScript.
--- End Message ---
--- Begin Message ---
tedd wrote:
At 6:47 PM -0400 7/25/08, Daniel Brown wrote:
On Fri, Jul 25, 2008 at 6:29 PM, tedd <[EMAIL PROTECTED]> wrote:
> But, there's nothing wrong with starting a sentence with but.
There, I even started AND ended with one.
Correct, as I said, in "Reader's Digest" English. In proper
grammar, it's tantamount to ending a sentence with a preposition[1].
However, even in Reader's Digest English (RDE[TM]), heading a word
with "but" is acceptable.... but following it immediately with a comma
is not[2].
1: Hence the name, "pre-position" --- positioned before.
2: http://www.michbar.org/journal/pdf/pdf4article628.pdf
As I see it, this is more of a "When to use a comma" thing than a "but"
thing.
I use commas like I talk. For example, I would never say:
But that didn't happen.
Instead, I would say
But -- pause -- that didn't happen.
So, I write it:
But, that didn't happen.
It's arguably more correct in this case to use ellipsis:
But ... I could be wrong :)
--
Peter Ford phone: 01580 893333
Developer fax: 01580 893399
Justcroft International Ltd., Staplehurst, Kent
--- End Message ---