How do you insert single & double qotes in MySql db without using PHP?

Questions by Lokesh M   answers by Lokesh M

Showing Answers 1 - 13 of 13 Answers

vinit sharma

  • Oct 26th, 2006

the new fool prrof method isto use PEAR and in that use prepare() execute method , or auto execute method . this takes care of mot just quotes , but all the html characters to be stored i the db .

  Was this answer useful?  Yes

Mohamed Yusuf

  • Dec 13th, 2006

escape single quote using forward slash ' .in double quote you don't need to escape quotes. insert as it ""


  • Feb 8th, 2007

there are 2 method:1. use escape back slash: " or '2. use "" or '' in the quoted string, e.g. ' it''s good' stands for : it's good, in the table.

  Was this answer useful?  Yes


  • Aug 14th, 2008

The way the question is formed - you would either:
1.) Use the MySQL CLI to perform an INSERT: INSERT INTO `myDB` (`col1`, `col2`) VALUES ('It's the best!', '"Mike" says hi!');

2.) Use another language other than PHP.

  Was this answer useful?  Yes


  • Sep 7th, 2011


  Was this answer useful?  Yes


  • Sep 12th, 2011

single quotes with'abc '
double quotes with "bcd "

  Was this answer useful?  Yes


  • Nov 24th, 2011

You can also use

  1. htmlspecialchars($string,ENT_QUOTES)


function for convert comma to special chars.

  Was this answer useful?  Yes


  • Dec 10th, 2014

  1. INSERT INTO tree_struct (`name`, `label`) VALUES (insertdata, "testing purpose");

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions