team2005
asked on
How to copy record from mysql that contains HTML code ?
Hi!
Have a record in mysql database, that contains a field than hav HTML in it.
I want to copy this record to a new record like:
The field that have HTML tekst is -> $content
How can i solve this ?
Tryed this to:
Have a record in mysql database, that contains a field than hav HTML in it.
I want to copy this record to a new record like:
$newsletter_data = $newsletter->get_newsletter($db,$newsletter_id);
session_start();
$golfclub_id=(int)$_SESSION['logoclub'];
$creatdate = date("Y-m-d");
$template = $newsletter_data['template'];
$subj = $newsletter_data['subject'];
$fromname = $newsletter_data['from_name'];
$fromemail = $newsletter_data['from_email'];
$content = .mysql_real_escape_string(($newsletter_data['content']).;
$bounceemail = $newsletter_data['bounce_email'];
$sql = "INSERT INTO `"._DB_PREFIX."newsletter` SET create_date='$creatdate', golf_id=$golfclub_id, template='$template', subject='$subj', from_name='$fromname', from_email='$fromemail', content='$content', bounce_email='$bounceemail'";
$res = query($sql,$db);
$newsletter_id = mysql_insert_id($db);
The field that have HTML tekst is -> $content
How can i solve this ?
Tryed this to:
$content = $newsletter_data['content'];
ASKER
Hi!
Have tested the same code, and just set :
$content = "Test";
And the record is created
Have tested the same code, and just set :
$content = "Test";
And the record is created
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks :)
You are welcome.
Wrong ->> https://dev.mysql.com/doc/refman/5.7/en/update.html
Right ->> http://dev.mysql.com/doc/refman/5.7/en/insert.html
You will also want to get off MySQL as soon as possible. Choose MySQLi or PDO.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html