Welcome Guest, Not a member yet? Register   Sign In
How to handle apostrophe i.e single quote while inserting to database
#1

[eluser]Musaddiq Khan[/eluser]
AOA,
I want to save "Toyo'" in database.
It works fine while inserting to database.
But the problem is when I fetch the data and want to use in javascript it create problem.
The code is below.
Code:
$(".order_detail").append('<div id="order_info_'+counter+'" class="order_info">
<select name="brand" id="" class="styled">
    <option value="0">Brand:</option>
    <option value="19">Toyo'</option>
    <option value="21">Art Galler...</option>
</select></div>');
#2

[eluser]Sanjay Sarvaiya[/eluser]
after fetching data add bellowed syntax that will fix your problem.
Code:
addslashes("toyo'");

for more information visit
http://www.php.net/manual/en/function.addslashes.php
#3

[eluser]Musaddiq Khan[/eluser]
Thanks Saru.




Theme © iAndrew 2016 - Forum software by © MyBB