Error while inserting ? as a value in mysql using Perl -


I am putting a URL in mysql . URL to ? , then when it is inserted using Perl, it is being reported as an error.

  Error 1064 (42000): There is an error in your SQL syntax;  

Question:

  Insert TEST_DB values ​​(1, 'http: // website), manual related to your MySQL server version for correct syntax Check it out. .com / hfsda / xxx-xxx-XX / XXXX = cccd ');   

I have tried to avoid with \? too, but did not work

Any thoughts?

I do not believe what you say is true. I believe that in fact you have asked to perform a different query. Find out exactly what you have executed.


Tested.

  Use strict; Use warnings; Use DBI Cue (); My $ host = 'localhost'; My $ db = '...'; My $ user = '...'; My $ passwd = '...'; My $ dbh = dbi- & gt; Connect ("dbi: mysql: host = $ host; database = $ db", $ user, $ passwd, {PrintError => 0, RaiseError => 1},); $ Dbh- & gt; Do (q {create temporary table template (id INT, url VARCHAR (255))}); $ Dbh- & gt; (T {TempTable values ​​(INSERT; (1, 'http://website.com/hfsda/xxx-xxx-xx/?xxxx=cccd')}); Print ("OK \ n");  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -