Re: [PHP] French characters

2009-10-19 Thread Don Proshetsky
Thanks.  For the database, there are many UTF8 collations.  Is this the 
recommended one?
UTF8_unicode-ci?
  - Original Message - 
  From: Mert Oztekin 
  To: 'Don' ; php-general@lists.php.net 
  Sent: Monday, October 19, 2009 9:13 AM
  Subject: RE: [PHP] French characters


  You may use UTF-8 both in your code and database. It is used more commonly. 
(almost seems to become a encoding standart)

  -Original Message-
  From: Don [mailto:d...@program-it.ca] 
  Sent: Monday, October 19, 2009 4:08 PM
  To: php-general@lists.php.net
  Subject: Re: [PHP] French characters

  I am using the following code:
  meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /


  Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message 
  news:e2c046087e10d943811a0bd0a4e8316d1bd2e81...@ankara.anadolusigorta.pvt...
  What about browsers encoding? And also, does your html code has a header 
  about character-encoding in french

  -Original Message-
  From: Don [mailto:d...@program-it.ca]
  Sent: Monday, October 19, 2009 3:58 PM
  To: php-general@lists.php.net
  Subject: [PHP] French characters

  Hi,

  I use PHP to read data form a mysql 5 table. allow the user to edit the data
  and then update the table.  I am having trouble with French characters.

  Before the update:  Pas de description détaillée
  After the update:Pas de description détaillée

  When I read from the table I wrap the data in the following:
  // Stripslashes
  if (!get_magic_quotes_gpc()) {
  $value = stripslashes($value);
  }
  // Convert all applicable characters to HTML entities
  $value = htmlentities($value,ENT_COMPAT);

  When I update to the table, I wrap in the following:
  // Addslashes
  if (!(get_magic_quotes_gpc())) {
 $value = addslashes($value);
  }
  // Quote if not a number or a numeric string
  if (!is_numeric($value)) {
 $value = @mysql_real_escape_string($value);
  }

  I've tried playing with character sets to no avail.  There mst be a
  solution,

  Thanks
  Don



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




  Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere özeldir ve 
  gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi bilgilendiriniz 
  ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile ilgili 
  olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadýr. 
  Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak veya geç 
  ulaþmasýndan, bütünlüðünün ve gizliliðinin korunamamasýndan, virüs 
  içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zarardan 
  sorumlu tutulamaz.

  This message and attachments are confidential and intended for the 
  individual(s) stated in this message. If you received this message in error, 
  please immediately notify the sender and delete it from your system. Our 
  company has no legal responsibility for the contents of the message and its 
  attachments. Our company shall have no liability for any changes or late 
  receiving, loss of integrity and confidentiality, viruses and any damages 
  caused in anyway to your computer system.



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



  
  Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere özeldir ve 
gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilendiriniz ve 
mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgili olarak 
sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir. Sirketimiz 
mesajin ve bilgilerinin size degisiklige ugrayarak veya geç ulasmasindan, 
bütünlügünün ve gizliliginin korunamamasindan, virüs içermesinden ve bilgisayar 
sisteminize verebilecegi herhangi bir zarardan sorumlu tutulamaz.

  This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.


Re: [PHP] French characters

2009-10-19 Thread Don Proshetsky


- Original Message - 
From: Phpster phps...@gmail.com

To: Don d...@program-it.ca
Cc: php-general@lists.php.net
Sent: Monday, October 19, 2009 9:33 AM
Subject: Re: [PHP] French characters




On Oct 19, 2009, at 9:29 AM, Don d...@program-it.ca wrote:


This doesn't not seem to be having an affect as the French  characters are
still written scrambled.

Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message
news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C11@ 
ankara.anadolusigorta.pvt...
You may use UTF-8 both in your code and database. It is used more 
commonly.

(almost seems to become a encoding standart)

-Original Message-
From: Don [mailto:d...@program-it.ca]
Sent: Monday, October 19, 2009 4:08 PM
To: php-general@lists.php.net
Subject: Re: [PHP] French characters

I am using the following code:
meta http-equiv=Content-Type content=text/html;  charset=iso-8859-1 
/



Mert Oztekin mozte...@anadolusigorta.com.tr wrote in message
news:E2C046087E10D943811A0BD0A4E8316D1BD2E81C0E@ 
ankara.anadolusigorta.pvt...

What about browsers encoding? And also, does your html code has a  header
about character-encoding in french

-Original Message-
From: Don [mailto:d...@program-it.ca]
Sent: Monday, October 19, 2009 3:58 PM
To: php-general@lists.php.net
Subject: [PHP] French characters

Hi,

I use PHP to read data form a mysql 5 table. allow the user to edit  the 
data

and then update the table.  I am having trouble with French  characters.

Before the update:  Pas de description détaillée
After the update:Pas de description détaillée

When I read from the table I wrap the data in the following:
   // Stripslashes
   if (!get_magic_quotes_gpc()) {
   $value = stripslashes($value);
   }
   // Convert all applicable characters to HTML entities
   $value = htmlentities($value,ENT_COMPAT);

When I update to the table, I wrap in the following:
   // Addslashes
   if (!(get_magic_quotes_gpc())) {
  $value = addslashes($value);
   }
   // Quote if not a number or a numeric string
   if (!is_numeric($value)) {
  $value = @mysql_real_escape_string($value);
   }

I've tried playing with character sets to no avail.  There mst be a
solution,

Thanks
Don



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



 
Bu mesaj ve ekleri, mesajda gönderildiði belirtilen kiþi/kiþilere  özeldir 
ve
gizlidir. Size yanlýþlýkla ulaþmýþsa lütfen gönderen kisiyi 
bilgilendiriniz

ve mesajý sisteminizden siliniz. Mesaj ve eklerinin içeriði ile  ilgili
olarak þirketimizin herhangi bir hukuki sorumluluðu bulunmamaktadý r.
Þirketimiz mesajýn ve bilgilerinin size deðiþikliðe uðrayarak  veya geç
ulaþmasýndan, bütünlüðünün ve gizliliðinin  korunamamasýndan, virüs
içermesinden ve bilgisayar sisteminize verebileceði herhangi bir zar ardan
sorumlu tutulamaz.

This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message  in 
error,

please immediately notify the sender and delete it from your system.  Our
company has no legal responsibility for the contents of the message  and 
its

attachments. Our company shall have no liability for any changes or  late
receiving, loss of integrity and confidentiality, viruses and any  damages
caused in anyway to your computer system.



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



 
Bu mesaj ve ekleri, mesajda gönderildigi belirtilen kisi/kisilere öz eldir 
ve
gizlidir. Size yanlislikla ulasmissa lütfen gönderen kisiyi bilgilen 
diriniz

ve mesaji sisteminizden siliniz. Mesaj ve eklerinin içerigi ile ilgi li
olarak sirketimizin herhangi bir hukuki sorumlulugu bulunmamaktadir.
Sirketimiz mesajin ve bilgilerinin size degisiklige ugrayarak veya g eç
ulasmasindan, bütünlügünün ve gizliliginin korunamamasindan, vir üs
içermesinden ve bilgisayar sisteminize verebilecegi herhangi bir zar ardan
sorumlu tutulamaz.

This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message  in 
error,

please immediately notify the sender and delete it from your system.  Our
company has no legal responsibility for the contents of the message  and 
its

attachments. Our company shall have no liability for any changes or  late
receiving, loss of integrity and confidentiality, viruses and any  damages
caused in anyway to your computer system.



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




You've used htmlentities to encode the characters, try 
http://php.net/manual/en/function.html-entity-decode.php

 to decode the string

Bastien=

Do you mean like this?


When I update to the table, I wrap in the following:
   // Addslashes
   if (!(get_magic_quotes_gpc())) {
  $value = addslashes($value);
   }
   // Quote if not a 

Re: [PHP] Removing an element from the middle of an mdlti-dimentsional array

2008-08-14 Thread Don Proshetsky

Yup, thanks.

Also execute:
   $array = array_values(array)
in order to fix the indexes

- Original Message - 
From: mike [EMAIL PROTECTED]

To: Don [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Thursday, August 14, 2008 11:16 PM
Subject: Re: [PHP] Removing an element from the middle of an 
mdlti-dimentsional array




Not on the specific sub element. I.e unset($array[2][0])

On Aug 14, 2008, at 8:08 PM, Don [EMAIL PROTECTED] wrote:


Won't unset() destroy the entire array?

mike [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Can't you unset() it? Sorry for top posting I'm on an iPhone

On Aug 14, 2008, at 7:30 PM, Don [EMAIL PROTECTED] wrote:


Hi,

Let's say I have the following array:

$myArray = array(array('1','2','3'), array('4','5','6'),
array('7','8','9'),
array('10','11','12'));

How do I remove say the second element?

I have tried: $myArray = array_splice($myArray, 1, 1);

But this seems to remove the second element as well as all the 
following

elements and I am left with:

$myArray = array(array('1','2','3'));

when I really want:

$myArray = array(array('1','2','3'), array('7','8','9'),
array('10','11','12'));


Thanks,
Don




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



No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.138 / Virus Database: 
270.6.3/1611 - Release Date: 8/14/2008 6:20 AM







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



[PHP] Concurrency in a multi-user environment

2007-11-21 Thread Don Proshetsky
Hi,

I'm been googling to see if I can find information on how programmers handle 
concurrency in a multi-user PHP/MySQL environment.  Here's a snippet of my 
app.

I have a form where users can maintain client information such as Name, 
Address, telephone, email, etc  I've been wondering how to handle a 
situation where two users are editing the same record.

One idea is to lock the record when User A enters but this may make it 
inaccessible for a long period if User A decided to get up and leave for a 
three hour lunch.  Also, does locking a record prevent file locks (when new 
records need to be added)?  Finally, locking a record means I have to 
convert from MyISAM to InnoDB but this is probably necessary for 
concurrency.

Another idea is to use a semaphore where User A enters and retrieves a 
numeric field in the table.  Upon leaving, the user locks and checks if the 
field is the same value. If yes, save, increment the numeric field and 
leave.  If not, it indicates another user entered has edited, saved and 
left.  I'm not crazy about this as it would mean User A could spend 15 
minutes updating a record only to get a message that User B already edited 
it.

Does anyone have any user friendly suggestions or can give me some URLs 
where I can read up on this?

Thanks,
Don 

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