Ok, thanks. It took a little bit of experimenting with printf(), sprintf()
and quotes, but I got it to work.

mysql_select_db($database_CCB, $CCB);
$ad_contact = "[EMAIL PROTECTED]<br>909-555-1212";
$esAdContact = mysql_escape_string($ad_contact);
$q = sprintf("UPDATE subscriber_ads 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


James Johnson wrote:
> Hi,
> 
> I'm trying to generate a string that contains a <br>, to insert into a 
> MySQL table. It appears the <br> 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

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

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

Reply via email to