Forum Moderators: coopster
For Example
Hello World
I am Johny, I Love Blah Blah and my Favourite Movie is "XyZ" and i love soccer
Now On Db this Text looks like
I am Johny, I Love Blah Blah and my Favourite Movie is \
Anyone Have Solution?
dc
My Code looks like this after your bode mysql_real_escape_string
$old_desc = $_POST['description'];
$description = mysql_real_escape_string($old_desc);
//-----------------------------------------
$sql = "INSERT INTO bidrequests (buyer, max_accepted, deadline, bid_type, bid_title, bid_body, attached_files, bid_status, starting_date, ending_date, platform, delieverables, parent, visible, project_type, category) VALUES ('$userisbuyer', '$maxbid', '$deadline', '$bidtype', '$title', '$description', '$attachedfilevar', '2', '$biddingstart', '$biddingclose', '$platform', '$delieverables', '$category', '0', '$projecttype', '$cate')";
$res=mysql_query($sql);
if ($res) {
And My Other Functions Goes On and On, But still the problem is Not Solved, Any One Please?
$description = str_replace('"','\\"',$old_desc);
// Uses \ to escape for mySQL.
$description = str_replace('"','\'"',$old_desc);
// Uses ' to escape like most other databases, should also work in mySQL.
These are untested so I can't be for sure they'll work, but if escaping that double quote is your problem they should do it.
-DR-
$old_desc = $_POST['description'];
$description = mysql_real_escape_string($old_desc);
//-----------------------------------------
$sql = "...";
// Dump info to browser and exit:
print '<pre>';
print htmlentities($_POST['description']) . "\n";
print htmlentities($old_desc) . "\n";
print htmlentities($description) . "\n";
print htmlentities($sql) . "\n";
print '<pre>';
exit [php.net];
// End of browser dump
$res=mysql_query($sql);