{"id":97,"date":"2008-07-28T13:17:04","date_gmt":"2008-07-28T17:17:04","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=97"},"modified":"2008-07-29T22:43:23","modified_gmt":"2008-07-30T02:43:23","slug":"php-mysql","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=97","title":{"rendered":"PHP MySql"},"content":{"rendered":"<p><strong>Safe query<\/strong><br \/>\nAgainst sql injection attack.<\/p>\n<pre lang=\"php\">\r\n$query = sprintf(\"INSERT INTO products (\r\n`name`, `description`, `user_id`) \r\nVALUES ('%s', '%s', %d)\",\r\nmysql_real_escape_string($product_name, $link),\r\nmysql_real_escape_string($product_description, $link),\r\n$_POST['user_id']);\r\n<\/pre>\n<p><strong>References<\/strong><br \/>\n<a href=\"http:\/\/www.php.net\/manual\/en\/book.mysql.php\">PHP Manual<\/a><br \/>\n<a href=\"http:\/\/www.php-mysql-tutorial.com\/\">Tutorial<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Safe query Against sql injection attack. $query = sprintf(&#8220;INSERT INTO products ( `name`, `description`, `user_id`) VALUES (&#8216;%s&#8217;, &#8216;%s&#8217;, %d)&#8221;, mysql_real_escape_string($product_name, $link), mysql_real_escape_string($product_description, $link), $_POST[&#8216;user_id&#8217;]); References PHP Manual Tutorial<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[20],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-php"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-1z","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":0,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}