{"id":191,"date":"2017-08-28T01:04:49","date_gmt":"2017-08-28T01:04:49","guid":{"rendered":"http:\/\/www.theperfectarts.com\/?p=191"},"modified":"2018-08-13T15:23:36","modified_gmt":"2018-08-13T15:23:36","slug":"simple-php-script-to-check-database-connection","status":"publish","type":"post","link":"https:\/\/www.ktchost.com\/blog\/simple-php-script-to-check-database-connection\/","title":{"rendered":"Simple php script to check database connection?"},"content":{"rendered":"<blockquote><p>To check the database connection script you can use following code under your domain<\/p>\n<p><span style=\"color: #800000;\">&lt;?php<br \/>\nmysql_connect(&#8220;localhost&#8221;, &#8220;admin&#8221;, &#8220;1admin&#8221;) or die(mysql_error());<br \/>\necho &#8220;Connected to MySQL&lt;br \/&gt;&#8221;;<br \/>\nmysql_select_db(&#8220;test&#8221;) or die(mysql_error());<br \/>\necho &#8220;Connected to Database&#8221;;<br \/>\n?&gt;<\/span><\/p>\n<p>After browsing the database connection script you will see following content if database connect to your server.<\/p><\/blockquote>\n<p><span style=\"color: #800000;\">Connected to MySQL<br \/>\nConnected to Database<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>To check the database connection script you can use following code under your domain &lt;?php mysql_connect(&#8220;localhost&#8221;, &#8220;admin&#8221;, &#8220;1admin&#8221;) or die(mysql_error()); echo &#8220;Connected to MySQL&lt;br \/&gt;&#8221;; <a class=\"mh-excerpt-more\" href=\"https:\/\/www.ktchost.com\/blog\/simple-php-script-to-check-database-connection\/\" title=\"Simple php script to check database connection?\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":6493,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,56],"tags":[],"class_list":["post-191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/191"}],"collection":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":13,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/191\/revisions\/195"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media\/6493"}],"wp:attachment":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}