{"id":50,"date":"2010-05-06T18:57:00","date_gmt":"2010-05-06T18:57:00","guid":{"rendered":"http:\/\/www.codeboss.in\/web-funda\/?p=50"},"modified":"2010-05-06T18:57:00","modified_gmt":"2010-05-06T18:57:00","slug":"handle-quotes-in-mysql-query-using-zend-framework","status":"publish","type":"post","link":"https:\/\/codeboss.in\/web-funda\/2010\/05\/06\/handle-quotes-in-mysql-query-using-zend-framework\/","title":{"rendered":"Handle Quotes In MySQL Query Using Zend Framework"},"content":{"rendered":"<p>When a value that needs to be inserted into database, contains a mix of &nbsp; &#8216; and &#8221; &nbsp;, problem will arise with normal MySQL query.<\/p>\n<p>We can handle the situation when using plain PHP with <a href=\"http:\/\/www.codeboss.in\/web-funda\/2009\/03\/27\/mysql-single-and-double-quotes-insertion\/\">this solution<\/a>.<\/p>\n<p>But if we are using Zend Framework the solution will be &#8211;<\/p>\n<p>$db = Zend_Db::factory(&#8216;PDO_MYSQL&#8217;, $params);<br \/>$sql = &#8220;Insert Into table_name (key, value) Values (&#8220;.$db-><b>quote<\/b>($valueWithQuotes) .&#8221;)&#8221;;<br \/>$result = $db->query($sql);<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a value that needs to be inserted into database, contains a mix of &nbsp; &#8216; and &#8221; &nbsp;, problem will arise with normal MySQL query. We can handle the situation when using plain PHP with this solution. But if we are using Zend Framework the solution will be &#8211; $db = Zend_Db::factory(&#8216;PDO_MYSQL&#8217;, $params);$sql =&hellip; <a class=\"more-link\" href=\"https:\/\/codeboss.in\/web-funda\/2010\/05\/06\/handle-quotes-in-mysql-query-using-zend-framework\/\">Continue reading <span class=\"screen-reader-text\">Handle Quotes In MySQL Query Using Zend Framework<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[56,67],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-mysql","tag-zend-framework","entry"],"_links":{"self":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":0,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeboss.in\/web-funda\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}