Re: [PHP] formatting a string

2004-04-24 Thread Andy B
[snip] $phone = '1234567890'; $newphone = preg_replace('/(\d{3})(\d{3})(\d)/','(\1)\2-\3',$phone); echo $newphone.''; -- regards, Tom [/snip] ok sorry but since i never used preg_* before i dont quite get what some of this stuff means. i looked at the doc page for it but it doesnt make mention at

Re: [PHP] formatting a string

2004-04-24 Thread Tom Rogers
Hi, Sunday, April 25, 2004, 11:17:16 AM, you wrote: AB> hi... AB> i have a string i want to pull out of a database (mysql). the column name is AB> Phone1 and it is a 10 digit phone number. the raw string coming out of the AB> table column would look like this: 1234567890 AB> what i want to do is

RE: [PHP] Formatting a string for entry into MySQL

2003-09-23 Thread James Johnson
SET ad_contact = '%s' WHERE subid = 43", $esAdContact); $r = mysql_query($q, $CCB) or print(mysql_error()); Thanks, James -Original Message- From: Burhan Khalid [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 4:45 AM To: James Johnson; [EMAIL PROTECTED] Subject:

Re: [PHP] Formatting a string for entry into MySQL

2003-09-23 Thread Burhan Khalid
James Johnson wrote: Hi, I'm trying to generate a string that contains a , to insert into a MySQL table. It appears the is being stripped out either just before or during the update. http://www.php.net/mysql-escape-string -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PH