{"id":4464,"date":"2012-05-25T08:49:12","date_gmt":"2012-05-25T08:49:12","guid":{"rendered":"http:\/\/phpcodez.com\/?p=4464"},"modified":"2012-05-25T08:49:12","modified_gmt":"2012-05-25T08:49:12","slug":"mysql_select_db","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/mysql_select_db\/","title":{"rendered":"mysql_select_db()"},"content":{"rendered":"<p>It select a MySQL database<\/p>\n<p><strong>MySQL Table &#8211; Users<\/strong><br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| id | name |<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| \u00a01 | PHP \u00a0|<br \/>\n| \u00a02 | ASP \u00a0|<br \/>\n| \u00a03 | JSP \u00a0|<br \/>\n| \u00a04 | JS \u00a0|<br \/>\n| \u00a05 | AS \u00a0|<br \/>\n+&#8212;-+&#8212;&#8212;+<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>&lt;?php<br \/>\nmysql_pconnect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error());<br \/>\nmysql_select_db(&#8220;database_name&#8221;);<br \/>\necho mysql_result(mysql_query( &#8220;SELECT * FROM users&#8221;),1);<br \/>\nmysql_close();<br \/>\n?&gt;<\/p>\n<p><strong>Output<\/strong><\/p>\n<p>2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It select a MySQL database MySQL Table &#8211; Users +&#8212;-+&#8212;&#8212;+ | id | name | +&#8212;-+&#8212;&#8212;+ | \u00a01 | PHP \u00a0| | \u00a02 | ASP \u00a0| | \u00a03 | JSP \u00a0| | \u00a04 | JS \u00a0| | \u00a05 | AS \u00a0| +&#8212;-+&#8212;&#8212;+ Example &lt;?php mysql_pconnect(&#8220;localhost&#8221;, &#8220;root&#8221;, &#8220;phpcode&#8221;) or die(mysql_error()); mysql_select_db(&#8220;database_name&#8221;); echo mysql_result(mysql_query( &#8220;SELECT * FROM &hellip; <a href=\"http:\/\/phpcodez.com\/mysql_select_db\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">mysql_select_db()<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[213,332,370],"class_list":["post-4464","post","type-post","status-publish","format-standard","hentry","category-php","tag-functions","tag-mysql","tag-php"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=4464"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4464\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=4464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=4464"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=4464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}