Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest! Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentTimeSep 23rd 2010
    Hey asdf what is the best data type of storing different characters like apostrophe dash etc. coz' I use text but it don't save the data when it has included special characters.Thanks!
  1. Other Topics You Might Like
    What is the best field type for containing long text on mysql
    A special message for frysLies and Paul Macias
    Sun buys MySQL for $1 billion
    Special Session within EMS2009: Media Interactivity and Network Convergence (MINC2009) wl
    I hate go back carts! Especially when POS is down!
    • CommentTimeSep 24th 2010 edited
    Its because PHP and MySQL reads the characters as code. You have to escape the text with  
    $string = mysql_real_escape_string($string);  
    $string = $conn->real_escape_string($string);
    • CommentTimeSep 24th 2010
    when i copy a long text from other website and copy it on my site, why it won't save the data on mysql database?
    • CommentTimeSep 25th 2010
    Invalid syntax. You need to escape " and ' characters so they don't conflict with actual code.  
    its like echo "hello" asdf " won't 'print' on the "screen!";  
    You can do this though:  
    $text =<<< BLAH  
    "hello" asdf " won't 'print' on the "screen!"  
    echo $text;  
    echo "hello\" asdf \" won't 'print' on the \"screen!";