{"id":194,"date":"2012-10-01T12:13:41","date_gmt":"2012-10-01T17:13:41","guid":{"rendered":"http:\/\/thenoyes.com\/littlenoise\/?p=194"},"modified":"2012-10-01T12:20:20","modified_gmt":"2012-10-01T17:20:20","slug":"connection-conundrum","status":"publish","type":"post","link":"https:\/\/thenoyes.com\/littlenoise\/?p=194","title":{"rendered":"Connection Conundrum"},"content":{"rendered":"<p>Define a user like this:<\/p>\n<p><code>GRANT ALL ON *.* TO 'myuser'@'localhost' IDENTIFIED BY 'super$ecret';<\/code><\/p>\n<p>Then try a PHP script like this:<\/p>\n<p><code>&lt;?php<br \/>\nmysqli_connect(\"localhost\", \"myuser\", \"super$ecret\");<br \/>\n?><\/code><\/p>\n<p>What happens and why? How could you avoid it?<\/p>\n<p>And for glory, what single line could you add that would prevent the error, without making any changes to the mysqli_connect line?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Define a user like this: GRANT ALL ON *.* TO &#8216;myuser&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;super$ecret&#8217;; Then try a PHP script like this: &lt;?php mysqli_connect(&#8220;localhost&#8221;, &#8220;myuser&#8221;, &#8220;super$ecret&#8221;); ?> What happens and why? How could you avoid it? And for glory, what single line could you add that would prevent the error, without making any changes to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":[6,7],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-gotchas","category-gotchas-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2IBF1-38","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":4,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thenoyes.com\/littlenoise\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}